Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
4.5 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 |
|
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. Remarks: If this is enabled the PDF will also be tagged (accessible) Currently only works in old Headless (headless = 'shell') Chromium feature request |
|
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 |
|
width |
|
string | number |
Sets the width of paper. You can pass in a number or a string with a unit. |