Skip to content

Commit 9baf701

Browse files
committed
Some more {options}
1 parent ed29353 commit 9baf701

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

jspdf.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -332,9 +332,9 @@ PubSub implementation
332332
options = orientation;
333333

334334
orientation = options.orientation;
335-
unit = options.unit;
336-
format = options.format;
337-
compressPdf = options.compress || options.compressPdf;
335+
unit = options.unit || unit;
336+
format = options.format || format;
337+
compressPdf = options.compress || options.compressPdf || compressPdf;
338338
}
339339

340340
// Default parameter values
@@ -394,16 +394,16 @@ PubSub implementation
394394
'ledger': [1224, 792],
395395
'tabloid': [792, 1224]
396396
},
397-
textColor = '0 g',
398-
drawColor = '0 G',
397+
textColor = options.textColor || '0 g',
398+
drawColor = options.drawColor || '0 G',
399399
page = 0,
400400
pages = [],
401401
objectNumber = 2, // 'n' Current object number
402402
outToPages = !!options.outToPages, // switches where out() prints. outToPages true = push to pages obj. outToPages false = doc builder content
403403
offsets = [], // List of offsets. Activated and reset by buildDocument(). Pupulated by various calls buildDocument makes.
404404
fonts = {}, // collection of font objects, where key is fontKey - a dynamically created label for a given font.
405405
fontmap = {}, // mapping structure fontName > fontStyle > font key - performance layer. See addFont()
406-
activeFontSize = 16,
406+
activeFontSize = options.fontSize || 16,
407407
activeFontKey, // will be string representing the KEY of the font as combination of fontName + fontStyle
408408
lineWidth = options.lineWidth || 0.200025, // 2mm
409409
lineHeightProportion = options.lineHeight || 1.15,
@@ -1955,6 +1955,8 @@ Examples:
19551955

19561956
if (typeof define === 'function') {
19571957
define(function(){return jsPDF});
1958+
} else {
1959+
global.jsPDF = jsPDF;
19581960
}
1959-
return global.jsPDF = jsPDF;
1961+
return jsPDF;
19601962
}(this));

0 commit comments

Comments
 (0)