HTML to PDF API
Send HTML, a URL or Markdown in one request and get the PDF back in the response, rendered by Chromium.
Convert HTML to PDF in one request
POST the HTML to /quickjob with your API key. The response body is the PDF.
HTML to PDF with curl
curl -X POST https://api.podpdf.com/quickjob \
-H "X-API-Key: $PODPDF_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input_type": "html",
"html": "<h1>Invoice INV-1042</h1><p>Total due: $850.00</p>",
"options": {
"format": "A4",
"margin": { "top": "20mm", "bottom": "20mm" },
"printBackground": true
}
}' \
--output invoice.pdf HTML to PDF in Node.js
const res = await fetch('https://api.podpdf.com/quickjob', {
method: 'POST',
headers: {
'X-API-Key': process.env.PODPDF_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
input_type: 'html',
html: '<h1>Hello</h1><p>Rendered by Chromium.</p>',
options: { format: 'Letter', landscape: false },
}),
});
const pdf = Buffer.from(await res.arrayBuffer());
console.log('pages:', res.headers.get('X-PDF-Pages')); URL to PDF
curl -X POST https://api.podpdf.com/quickjob \
-H "X-API-Key: $PODPDF_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "input_type": "url", "url": "https://example.com/" }' \
--output page.pdf Page numbers in the footer
curl -X POST https://api.podpdf.com/quickjob \
-H "X-API-Key: $PODPDF_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input_type": "html",
"html": "<h1>Quarterly report</h1>...",
"options": {
"margin": { "top": "15mm", "bottom": "20mm" },
"displayHeaderFooter": true,
"headerTemplate": "<span></span>",
"footerTemplate": "<div style=\"font-size:9px;width:100%;text-align:center\">Page <span class=\"pageNumber\"></span> of <span class=\"totalPages\"></span></div>"
}
}' \
--output report.pdf - Up to 25 pages in under 30 seconds
- Up to 5 MB of HTML per request
- The X-PDF-Pages header gives the page count
- Longer documents: POST /longjob, up to 100 pages
What the HTML to PDF API handles
Real Chromium rendering
Flexbox, grid, web fonts, SVG and print CSS render the way they do in Chrome, so what you design in the browser is what lands in the PDF.
PDF back in the response
Up to 25 pages come back as the response body within 30 seconds. No polling, no second request.
Long documents and bulk runs
Queue documents up to 100 pages with a webhook when they finish, or convert 200 HTML and Markdown files in one bulk job.
Paper, margins, headers, footers
A4, Letter or any custom size, landscape, margins, page ranges, and header and footer templates with page numbers.
Accessible PDF/UA output
Ask for PDF/UA-1 or PDF/UA-2 and get a tagged PDF checked by veraPDF (alpha).
Also from Zapier, n8n and MCP
The same conversion runs from no-code tools and AI agents, with the same API key.
HTML to PDF API questions
Which HTML and CSS features are supported?
Can I convert a URL to PDF?
How do I add page numbers?
What does it cost?
What if my document is longer than 25 pages?
Can I convert Markdown too?
Generating the same document again and again?
Design an invoice, receipt or certificate as a template once, then send only the data as JSON.