Skip to main content

PDF Params

PDF Params options

Here’s a list of all the optional parameters that you can send as an object “pdfParams” while using our HTML to PDF endpoint:
Whether to show the header and footer. Default: false
string
HTML template for the header. See valid HTML markup bellow.
HTML template for the footer. See valid HTML markup bellow.
boolean
Set to true to print background graphics. Default: false
boolean
Whether to print in landscape orientation. Default: false
PaperFormat
All the valid paper format types when printing a PDF. See all format options here. Default: Letter
string | number
Paper width, accepts values labeled with units.
string | number
Paper height, accepts values labeled with units.
object
Object that sets the margin of every page. See all margin options here.
boolean
Give any CSS @page size declared in the page priority over what is declared in the width or height or format option. Default: false
boolean
Whether or not to embed the document outline into the PDF. Default: false
The width, height, and margin options accept values labeled with units. Unlabeled values are treated as pixels.All possible formats:
  • width: 100 (prints with width set to 100 pixels)
  • width: ‘100px’ (prints with width set to 100 pixels)
  • width: ‘100in’ (prints with width set to 100 inches)
  • width: ‘100cm,’ (prints with width set to 100 centimeters)
  • width: ‘100mm’ (prints with width set to 100 millimeters)

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
Example:

Paper format options


Margin Options

string | number
Top margin, accepts values labeled with units. Default: 0
string | number
Right margin, accepts values labeled with units. Default: 0
string | number
Left margin, accepts values labeled with units. Default: 0
string | number
Bottom margin, accepts values labeled with units. Default: 0
  • Example: