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: "Letter" | "Legal" | "Tabloid" | "Ledger" | "A0" | "A1" | "A2" | "A3" | "A4" | "A5" | "A6"

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

height: string | number

Paper height.

Optional landscape

landscape: boolean

Paper orientation.

default

false

Optional margin

margin: { bottom?: string | number; left?: string | number; right?: string | number; top?: string | number }

Paper margins, defaults to none.

Type declaration

  • Optional bottom?: string | number

    Bottom margin.

  • Optional left?: string | number

    Left margin.

  • Optional right?: string | number

    Right margin.

  • Optional top?: string | number

    Top margin.

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.

default

1

Optional width

width: string | number

Paper width.

Generated using TypeDoc