@@ -326,6 +326,16 @@ PubSub implementation
326326@private
327327*/
328328 function jsPDF ( orientation , unit , format , compressPdf ) { /** String orientation, String unit, String format, Boolean compressed */
329+ var options = { } ;
330+
331+ if ( typeof orientation === 'object' ) {
332+ options = orientation ;
333+
334+ orientation = options . orientation ;
335+ unit = options . unit ;
336+ format = options . format ;
337+ compressPdf = options . compress || options . compressPdf ;
338+ }
329339
330340 // Default parameter values
331341 if ( typeof orientation === 'undefined' ) {
@@ -338,7 +348,7 @@ PubSub implementation
338348 if ( typeof compressPdf === 'undefined' && typeof zpipe === 'undefined' ) { compressPdf = false ; }
339349
340350 var format_as_string = format . toString ( ) . toLowerCase ( ) ,
341- version = '0.9.0rc2 ' ,
351+ version = '1.0.0-trunk ' ,
342352 content = [ ] ,
343353 content_length = 0 ,
344354 compress = compressPdf ,
@@ -389,14 +399,14 @@ PubSub implementation
389399 page = 0 ,
390400 pages = [ ] ,
391401 objectNumber = 2 , // 'n' Current object number
392- outToPages = false , // switches where out() prints. outToPages true = push to pages obj. outToPages false = doc builder content
402+ outToPages = ! ! options . outToPages , // switches where out() prints. outToPages true = push to pages obj. outToPages false = doc builder content
393403 offsets = [ ] , // List of offsets. Activated and reset by buildDocument(). Pupulated by various calls buildDocument makes.
394404 fonts = { } , // collection of font objects, where key is fontKey - a dynamically created label for a given font.
395405 fontmap = { } , // mapping structure fontName > fontStyle > font key - performance layer. See addFont()
396406 activeFontSize = 16 ,
397407 activeFontKey , // will be string representing the KEY of the font as combination of fontName + fontStyle
398- lineWidth = 0.200025 , // 2mm
399- lineHeightProportion = 1.15 ,
408+ lineWidth = options . lineWidth || 0.200025 , // 2mm
409+ lineHeightProportion = options . lineHeight || 1.15 ,
400410 pageHeight ,
401411 pageWidth ,
402412 k , // Scale factor
0 commit comments