Convert options
Main request payload for `POST /v1/convert`.
{
"source": "<html>...</html>" | "https://example.com",
"format": "A4" | "Letter" | "Legal" | "A3" | "A5",
"orientation": "portrait" | "landscape",
"margin": { "top": "10px", "right": "10px", "bottom": "10px", "left": "10px" },
"header": { "source": "<div>Header</div>", "height": "20mm" },
"footer": { "source": "<div>Footer</div>", "height": "20mm" },
"watermark": { "source": "<div>Draft</div>", "offset_x": 0, "offset_y": 0, "rotate": 0, "opacity": 0.2 },
"sandbox": false,
"wait_for": "#ready",
"javascript": true,
"delay": 250,
"viewport": { "width": 1280, "height": 720 },
"custom_css": "body { font-family: Inter; }",
"custom_js": "window.__ready = true;",
"page_ranges": "1-3",
"scale": 1.0,
"print_background": true,
"protection": {
"author": "Acme Inc",
"user_password": "viewer-pass",
"owner_password": "owner-pass",
"no_print": false,
"no_copy": false,
"no_modify": false
},
"webhook": "https://your-app.com/pdf-callback",
"filename": "invoice.pdf",
"encode": false
}Async mode
Use `/v1/convert/async` for large rendering jobs, then poll `/v1/jobs/{job_id}`. If `webhook` is provided, API returns queued response and posts completion payload to your callback URL.
High-fidelity controls
custom_cssinjects runtime styles before rendering.custom_jsinjects runtime JavaScript for dynamic pages.page_rangessupports ranges like1-3,5.scaletunes PDF zoom from 0.1 to 2.0.print_backgroundtoggles background color/image rendering.protectionadds PDF passwords and print/copy/modify restrictions.webhookenables asynchronous callback delivery for convert completion.filenamecontrols the response filename in encoded mode.