PDFs
Turn HTML, Markdown or any URL into a print-ready PDF, rendered by Chrome: flexbox, grid and web fonts work. 1 credit per PDF.
GET | POST
/v1/pdfcurl -X POST https://shotlane.dev/v1/pdf \
-H "X-API-Key: $SHOTLANE_API_KEY" -H "Content-Type: application/json" \
-d '{"html":"<h1>Invoice #42</h1><p>Total: $20</p>","paper":"Letter","page_numbers":true}' -o invoice.pdf
Every screenshot option works here too (url, html, markdown, wait_for_selector, cookies, css, hide_cookie_banners…), plus these:
Page setup
| Parameter | Default | Description |
|---|---|---|
paper | A4 | A0–A6, Letter, Legal, Tabloid, Ledger. |
pdf_fit_one_page | false | Put the whole page on one long PDF page instead of breaking it across sheets, e.g. for receipts or landing pages. |
landscape | false | Landscape orientation. |
pdf_widthpdf_height | — | A custom page size instead of paper, e.g. 100mm × 150mm for labels. |
margin | 0 | All four margins, e.g. 15mm, 1cm, 0.5in, 40px. Or set margin_top, margin_right, margin_bottom, margin_left. |
pdf_scale | 1 | Content scale, 0.1–2. |
page_ranges | — | Pages to keep, e.g. 1-3, 5. |
print_background | true | Include background colors and images and use screen styles. false uses your @media print CSS. |
Headers, footers and page numbers
| Parameter | Default | Description |
|---|---|---|
page_numbers | false | A centered 1 / N footer. |
header_templatefooter_template | — | HTML repeated on every page. Elements with the classes pageNumber, totalPages, date, title or url are filled in. Set font sizes inline; the default is tiny. |
{"html": "…", "margin": "20mm",
"footer_template": "<div style='font-size:9px;width:100%;text-align:right;padding:0 20mm'>Page <span class='pageNumber'></span> of <span class='totalPages'></span></div>"}
Watermarks, passwords and metadata
| Parameter | Default | Description |
|---|---|---|
watermark | — | Diagonal text on every page, e.g. DRAFT. watermark_opacity 0.03–1, default 0.15. |
pdf_password | — | Password-protect the PDF (AES-256). Optional pdf_owner_password. |
pdf_titlepdf_authorpdf_subjectpdf_keywords | — | Document metadata shown by PDF readers and used by search. |
Tips
- Force a page break with
break-before: pagein your CSS; keep rows together withbreak-inside: avoid. - Load images and fonts from absolute
https://URLs, or inline them as data URIs. - An LLM-written report? Send it as
markdown: tables, code blocks and lists get clean default styling.