HTML to PDF API — real Chromium rendering, one POST request

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.

One request, three languages

cURL
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
Node.js
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()));
Python
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.

Why not just run Puppeteer yourself?

You can — plenty of teams start there. The hidden costs show up later:

The browser fleet tax

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.

Cold starts & scale spikes

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.

wkhtmltopdf's frozen WebKit

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.

Frequently asked questions

Is there a free HTML to PDF API tier?
Yes — 100 PDFs per month, free forever, no credit card and no watermark. Paid plans start at $15/month for 1,000 PDFs. See how that compares to other PDF APIs.
Does it support CSS grid, flexbox and web fonts?
Yes. Rendering runs on current headless Chromium, so anything Chrome can display — grid, flexbox, custom fonts, SVG, gradients — ends up in the PDF exactly as rendered.
How do I set page size, orientation and margins?
Pass an options object: {"format":"Letter","landscape":true,"margin":{"top":"20mm","right":"15mm","bottom":"20mm","left":"15mm"}}. Formats cover Letter, Legal, Tabloid, Ledger and A0–A6; your CSS @page size is respected too.
Can I use it from Zapier or Make?
Yes — it's a plain REST endpoint, and PDFMint accepts stringified JSON for data/options fields, which is exactly how no-code tools send them.
How fast is it?
Median ~600 ms per document on a warm engine. Our status page runs a real render through the production pipeline every few minutes and publishes the latency — check it live.

Your first PDF is 30 seconds away

Free tier: 100 PDFs/month. Or try it with zero signup in the live demo.

Get your free API key →