Send your HTML and CSS, get back a pixel-perfect PDF in about 600 ms. PDFMint's HTML to PDF API runs real headless Chromium — the same engine your users' browsers use — so flexbox, CSS grid, custom fonts and print stylesheets render exactly as designed. No browser fleet to babysit, no version drift, no cold starts.
curl -X POST https://pdfmintapi.com/v1/generate/html \
-H "Authorization: Bearer pm_your_key" \
-H "Content-Type: application/json" \
-d '{"html":"<h1>Hello PDF</h1><p>Rendered by Chromium.</p>"}' \
--output hello.pdf
const res = await fetch('https://pdfmintapi.com/v1/generate/html', { method: 'POST', headers: { Authorization: 'Bearer pm_your_key', 'Content-Type': 'application/json' }, body: JSON.stringify({ html: '<h1>Hello PDF</h1>', options: { format: 'A4' } }) }); await require('fs').promises.writeFile('hello.pdf', Buffer.from(await res.arrayBuffer()));
import requests r = requests.post('https://pdfmintapi.com/v1/generate/html', headers={'Authorization': 'Bearer pm_your_key'}, json={'html': '<h1>Hello PDF</h1>', 'options': {'format': 'Letter', 'landscape': True}}) open('hello.pdf', 'wb').write(r.content)
Options: format (Letter, Legal, Tabloid, Ledger, A0–A6), landscape, and per-side margin. Full reference in the API docs.
You can — plenty of teams start there. The hidden costs show up later:
Chromium eats ~300 MB of RAM per instance, leaks under load, and needs version updates that periodically break rendering. Someone on your team becomes the browser janitor.
Serverless Puppeteer means multi-second cold starts and hard memory ceilings. PDFMint keeps a warm browser pool with queueing and hard render timeouts built in.
The classic library runs a WebKit build from 2012 — no flexbox, no grid, endless CSS workarounds. Chromium renders your HTML the way you previewed it.
@page size, preferCSSPageSize, background graphics onFree tier: 100 PDFs/month. Or try it with zero signup in the live demo.
Get your free API key →