Adds the ability to set ViewerPreferences and by thus controlling the way the document is to be presented on the screen or in print.
- Source:
Methods
(inner) viewerPreferences(options, doReset)
- Source:
Set the ViewerPreferences of the generated PDF
Example
var doc = new jsPDF()
doc.text('This is a test', 10, 10)
doc.viewerPreferences({'FitWindow': true}, true)
doc.save("viewerPreferences.pdf")
// Example printing 10 copies, using cropbox, and hiding UI.
doc.viewerPreferences({
'HideWindowUI': true,
'PrintArea': 'CropBox',
'NumCopies': 10
})
Parameters:
Name | Type | Description |
---|---|---|
options |
Object | Array with the ViewerPreferences |
doReset |
boolean | True to reset the settings |
Returns:
jsPDF jsPDF-instance