PDFOptions interface
Valid options to configure PDF generation via Page.pdf().
Signature
export interface PDFOptions
Properties
Property | Modifiers | Type | Description | Default |
---|---|---|---|---|
| boolean | Whether to show the header and footer. |
| |
| string | HTML template for the print footer. Has the same constraints and support for special classes as PDFOptions.headerTemplate. | ||
format |
| Remarks: If set, this takes priority over the |
| |
headerTemplate |
| string | HTML template for the print header. Should be valid HTML with the following classes used to inject values into them:
| |
height |
| string | number | Sets the height of paper. You can pass in a number or a string with a unit. | |
landscape |
| boolean | Whether to print in landscape orientation. |
|
margin |
| Set the PDF margins. |
| |
omitBackground |
| boolean | Hides default white background and allows generating pdfs with transparency. |
|
outline |
| boolean | (Experimental) Generate document outline. |
|
pageRanges |
| string | Paper ranges to print, e.g. | The empty string, which means all pages are printed. |
path |
| string | The path to save the file to. Remarks: If the path is relative, it's resolved relative to the current working directory. |
|
preferCSSPageSize |
| boolean | Give any CSS |
|
printBackground |
| boolean | Set to |
|
scale |
| number | Scales the rendering of the web page. Amount must be between |
|
tagged |
| boolean | (Experimental) Generate tagged (accessible) PDF. |
|
timeout |
| number | Timeout in milliseconds. Pass The default value can be changed by using Page.setDefaultTimeout() |
|
waitForFonts |
| boolean | If true, waits for |
|
width |
| string | number | Sets the width of paper. You can pass in a number or a string with a unit. |