PDF & Browser Options
Customize your PDF document output by passing the options and render blocks in your requests.
Layout and Styling Options (options)
These options determine the size, orientation, margins, and security metadata of the resulting PDF.
| Parameter | Type | Default | Available On | Description |
|---|---|---|---|---|
format | string | "A4" | All Plans | Paper formats: "A4", "A3", "Letter", "Legal", "Tabloid". |
landscape | boolean | false | All Plans | Set to true for horizontal landscape orientation. |
print_background | boolean | true | All Plans | Render background graphics, gradients, and colors declared in CSS. |
display_header_footer | boolean | false | All Plans | Enable header and footer rendering. Requires templates. |
header_template | string | null | All Plans | HTML string for the header. Classes allowed: pageNumber, totalPages, date, title, url. |
footer_template | string | null | All Plans | HTML string for the footer. Classes allowed: pageNumber, totalPages, date, title, url. |
margin.top | string | null | All Plans | Top page margin (e.g. "10mm", "20px", "0.5in"). |
margin.bottom | string | null | All Plans | Bottom page margin (e.g. "10mm", "20px"). |
margin.left | string | null | All Plans | Left page margin. |
margin.right | string | null | All Plans | Right page margin. |
scale | number | null | All Plans | Scale factor of the webpage rendering (between 0.5 and 2.0). If omitted, it will automatically scale down to fit the page width. |
watermark | object | null | Starter+ | Overlay watermark text. See Watermark parameters below. |
user_password | string | null | Pro+ | Encrypt and restrict access to the PDF with a password. |
compression | object | null | Pro+ | Optimize and compress the PDF file. See Compression parameters below. |
Watermark Parameters (options.watermark)
[!NOTE] Available on Starter plans and higher. If used on Free keys, an error is returned.
text(string, required): The watermark overlay text (e.g.,"CONFIDENTIAL").color(string, default:"rgba(200, 200, 200, 0.3)"): Transparent CSS color representation.font_size(string, default:"60px"): CSS font size for the watermark string.rotation_degrees(integer, default:-45): Watermark rotation angle.
Compression Parameters (options.compression)
[!NOTE] Available on Pro plans and higher.
level(integer, 1-9): Structural optimization.1-3basic compression,4-6object stream compression,7-9full linearization for web viewing.image_quality(integer, 1-100): JPEG lossy image re-compression quality.80-90is recommended for high compression with minimal quality loss.
Browser Options (render)
These parameters control browser behavior during loading and navigation.
| Parameter | Type | Default | Description |
|---|---|---|---|
page_load_timeout_ms | integer | 30000 | Navigation timeout in milliseconds before failing. Max 60000. |
wait_until | string | "load" | Load threshold event: "load", "domcontentloaded", "networkidle", "commit". |
wait_for_selector | string | null | CSS selector to wait for (e.g., "#charts-loaded") before taking the snapshot. |
wait_after_load_ms | integer | 0 | Artificial pause in milliseconds to wait for JS animations to finish. Max 10000 (10s). |