4.0 KiB
sidebar_label |
---|
PDFOptions |
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 |
|
| ||
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 |
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. |
|
preferCSSPageSize |
|
boolean |
Give any CSS |
|
printBackground |
|
boolean |
Set to |
|
scale |
|
number |
Scales the rendering of the web page. Amount must be between |
|
tagged |
|
boolean |
Generate tagged (accessible) PDF. |
|
timeout |
|
number |
Timeout in milliseconds. Pass |
|
width |
|
string | number |
Sets the width of paper. You can pass in a number or a string with a unit. |