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:
falseHTML template for the header. See valid HTML markup
bellow.
HTML template for the footer. See valid HTML markup
bellow.
Set to
true to print background graphics. Default: falseWhether to print in landscape orientation. Default:
falseAll the valid paper format types when printing a PDF. See all format options
here. Default:
LetterPaper width, accepts values labeled with units.
Paper height, accepts values labeled with units.
Object that sets the margin of every page. See all margin options
here.
Give any CSS
@page size declared in the page priority over what is declared
in the width or height or format option. Default: falseWhether or not to embed the document outline into the PDF. Default:
falseThe 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)
Header and Footer: Valid HTML Markups
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
Paper format options
| Format name | Size in inches | Size in cm |
|---|---|---|
Letter | 8.5in x 11in | 21.6cm x 27.9cm |
Legal | 8.5in x 14in | 21.6cm x 35.6cm |
Tabloid | 11in x 17in | 27.9cm x 43.2cm |
Ledger | 17in x 11in | 43.2cm x 27.9cm |
A0 | 33.1in x 46.8in | 84cm x 118.9cm |
A1 | 23.4in x 33.1in | 59.4cm x 84cm |
A2 | 16.54in x 23.4in | 42cm x 59.4cm |
A3 | 11.7in x 16.54in | 29.7cm x 42cm |
A4 | 8.27in x 11.7in | 21cm x 29.7cm |
A5 | 5.83in x 8.27in | 14.8cm x 21cm |
A6 | 4.13in x 5.83in | 10.5cm x 14.8cm |
Margin Options
Top margin, accepts values labeled with units. Default:
0Right margin, accepts values labeled with units. Default:
0Left margin, accepts values labeled with units. Default:
0Bottom margin, accepts values labeled with units. Default:
0- Example: