PDF Params
When using our HTML to PDF endpoint, you can send a whole list of parameters to help you better tailor your PDF layout.
When using reusable templates, these parameters are set on the interface, so you don't need send any extra parameters on the API.
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:
displayHeaderFooter
boolean
Whether to show the header and footer. default: false
headerTemplate
string
footerTemplate
string
printBackground
boolean
Set to true
to print background graphics. default: false
landscape
boolean
Whether to print in landscape orientation. default: false
format
PaperFormat
width
string
| number
Paper width, accepts values labeled with units.
height
string
| number
Paper height, accepts values labeled with units.
margin
Margin (object)
preferCSSPageSize
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
outline
boolean
Whether or not to embed the document outline into the PDF. default: false
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
Example:
Paper format options
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
string
| number
Top margin, accepts values labeled with units. default: 0
right
string
| number
Right margin, accepts values labeled with units. default: 0
left
string
| number
Left margin, accepts values labeled with units. default: 0
bottom
string
| number
Bottom margin, accepts values labeled with units. default: 0
Example:
Last updated