Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • PDFOptions

Index

Properties

Optional displayHeaderFooter

displayHeaderFooter: boolean

Display header and footer.

default

false

Optional footerTemplate

footerTemplate: string

HTML template for the print footer. Should be valid HTML markup with following classes used to inject printing values into them:

  • date formatted print date
  • title document title
  • url document location
  • pageNumber current page number
  • totalPages total pages in the document

Optional format

format: PdfFormat

Paper format. If set, takes priority over width or height options.

default

'Letter'

Optional headerTemplate

headerTemplate: string

HTML template for the print header. Should be valid HTML markup with following classes used to inject printing values into them:

  • date formatted print date
  • title document title
  • url document location
  • pageNumber current page number
  • totalPages total pages in the document

Optional height

Paper height.

Optional landscape

landscape: boolean

Paper orientation.

default

false

Optional margin

margin: { bottom?: LayoutDimension; left?: LayoutDimension; right?: LayoutDimension; top?: LayoutDimension }

Paper margins, defaults to none.

Type declaration

Optional pageRanges

pageRanges: string

Paper ranges to print, e.g., '1-5, 8, 11-13'.

default

'' which means print all pages.

Optional path

path: string

The file path to save the PDF to. If path is a relative path, then it is resolved relative to current working directory. If no path is provided, the PDF won't be saved to the disk.

Optional preferCSSPageSize

preferCSSPageSize: boolean

Give any CSS @page size declared in the page priority over what is declared in width and height or format options.

default

false which will scale the content to fit the paper size.

Optional printBackground

printBackground: boolean

Print background graphics.

default

false

Optional scale

scale: number

Scale of the webpage rendering. Between 0.1 and 2.

default

1

Optional width

Paper width.