Page Setup & Margins

Control PDF paper formats, orientation layouts, margins, zoom levels, viewports, and custom ranges.

page_size select
Default: "A4"

Standard paper format. ISO A-series: A0–A9. ISO B-series: B0–B9. Named: C5E, Comm10E, DLE, Executive, Folio, Ledger, Legal, Letter, Tabloid. Use "Custom" with page_width + page_height for any arbitrary size.

Available options:
A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 C5E Comm10E DLE Executive Folio Ledger Legal Letter Tabloid Custom
page_width text
Default: ""

Page width in mm, cm, in, px or pt.

page_height text
Default: ""

Page height in mm, cm, in, px or pt.

orientation select
Default: "vertical"

Sets the orientation of the created pdf document: vertical (portrait) or horizontal (landscape).

Available options:
portrait landscape vertical horizontal
use_print_media boolean
Default: false

Set to true in order to activate CSS @media print declarations.

viewport text
Default: "1440x900"

Viewport size to render your html in (e.g. 1440x900).

zoom number
Default: "1"

Adjust the HTML zoom factor.

print_pages text
Default: ""

Pages to print. Can be single number (3), range (1-5), list (4,5,6) or mixed (1-3,6).

margin_top text
Default: "0px"

Margin at the top of the page in mm, cm, in, px or pt.

margin_bottom text
Default: "0px"

Margin at the bottom of the page in mm, cm, in, px or pt.

margin_left text
Default: "0px"

Margin at the left of the page in mm, cm, in, px or pt.

margin_right text
Default: "0px"

Margin at the right of the page in mm, cm, in, px or pt.