HTML to PDF API
POST your HTML or a public URL to https://render.cuelark.com/v1/pdf and get back a PDF printed by real Chromium, with your CSS, fonts and page size.
Header and footer
Use {page}, {pages}, {title}, {date}. Split with | for left, center and right. Shown on every page.
PDFs are printed by Chromium on Cloudflare and streamed back. Nothing is stored. Free: 10 PDF or screenshot renders a day per IP.
Request
curl -X POST https://render.cuelark.com/v1/pdf \
-H "content-type: application/json" \
-d '{"html":"<h1>Invoice #1042</h1><p>Total: $1,250.00</p>","format":"letter","margin":"0.5in"}' \
-o invoice.pdfFrom JavaScript
const res = await fetch("https://render.cuelark.com/v1/pdf", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({ url: "https://example.com", format: "a4" }),
});
const pdf = await res.arrayBuffer();Options
| Field | Values | Default |
|---|---|---|
| html or url | HTML up to 2 MB, or a public http(s) URL | - |
| format | letter, legal, tabloid, a3, a4, a5 | letter |
| landscape | true / false | false |
| margin | e.g. 0.5in, 12mm, 24px | 0.5in |
| background | print CSS backgrounds | true |
| cssPageSize | use your @page size | false |
| javascript | false to disable scripts | true |
| filename | download name | render |
Limits and safety
- Free without a key: 10 PDF or screenshot renders per day per IP. With a free Cuelark API key: 50 a day per account.
- Pages get 15 seconds to load. Output is capped at 12 MB.
- Private IP ranges, internal hostnames and cloud metadata addresses are blocked, also for requests made from inside your HTML.
- Your HTML and the PDF aren't stored or logged.
Do it from code or an AI assistant
The same renderer is an HTTP API and an MCP tool, so this exact result can come from a script or from Claude, ChatGPT or Cursor. See the Render API reference and the MCP setup guide.
HTTP API
curl -X POST https://render.cuelark.com/v1/pdf -H "content-type: application/json" \
-d '{"html":"<h1>Quarterly report</h1><p>Q3 2026</p>","format":"letter","margin":"0.5in","header":"Acme Inc. | Confidential"}' \
-o document.pdfMCP tool call: html_to_pdf
{
"method": "tools/call",
"params": {
"name": "html_to_pdf",
"arguments": {
"html": "<h1>Quarterly report</h1><p>Q3 2026</p>",
"format": "letter",
"margin": "0.5in",
"header": "Acme Inc. | Confidential"
}
}
}Frequently asked questions
Does it support CSS and web fonts?
Yes. It's real Chromium, so Flexbox, Grid, @font-face, Google Fonts and print CSS like @page and break-before all work.
Letter or A4 by default?
US Letter by default. Pass "format":"a4" for A4.
Can I call it from n8n?
Yes. Use an HTTP Request node: POST, JSON body, response format File. The PDF comes back as binary data.
How do I add page breaks?
Add style="break-before: page" (or page-break-before: always) to the element that should start a new page.
Related free tools from Cuelark
Updated November 10, 2026 by the Cuelark Team.