savePDF
Prints the page of the current browsing context to a PDF file on your OS.
#
Usage#
ParametersName | Type | Details |
---|---|---|
filepath | String | path to the generated pdf (.pdf suffix is required) relative to the execution directory |
options optional | PDFPrintOptions | Print PDF Options |
options.orientation optional | String | Orientation of PDF page |
options.scale optional | number | Scale of PDF page |
options.background optional | boolean | Include background of PDF page |
options.width optional | number | Width of PDF page |
options.height optional | number | Height of PDF page |
options.top optional | number | Top padding of PDF page |
options.bottom optional | number | Bottom padding of PDF page |
options.left optional | number | Left padding of PDF page |
options.right optional | number | Right padding of PDF page |
options.shrinkToFit optional | boolean | Shrink page to fit page |
options.pageRanges optional | Array.<object> | Range of pages to include in PDF |
#
ExamplesavePDF.js