You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							26 lines
						
					
					
						
							499 B
						
					
					
				
			
		
		
		
			
			
			
		
		
	
	
							26 lines
						
					
					
						
							499 B
						
					
					
				
								var PDF = require('./pdf')
							 | 
						|
								
							 | 
						|
								module.exports = {
							 | 
						|
								  create: function createPdf (html, options, callback) {
							 | 
						|
								    if (arguments.length === 1) {
							 | 
						|
								      return new PDF(html)
							 | 
						|
								    }
							 | 
						|
								
							 | 
						|
								    if (arguments.length === 2 && typeof options !== 'function') {
							 | 
						|
								      return new PDF(html, options)
							 | 
						|
								    }
							 | 
						|
								
							 | 
						|
								    if (arguments.length === 2) {
							 | 
						|
								      callback = options
							 | 
						|
								      options = {}
							 | 
						|
								    }
							 | 
						|
								
							 | 
						|
								    try {
							 | 
						|
								      var pdf = new PDF(html, options)
							 | 
						|
								    } catch (err) {
							 | 
						|
								      return callback(err)
							 | 
						|
								    }
							 | 
						|
								
							 | 
						|
								    pdf.exec(callback)
							 | 
						|
								  }
							 | 
						|
								}
							 | 
						|
								
							 |