HTML to PDF API
HTML to PDF API — Invoices, Reports, Resumes
Render any URL or raw HTML to PDF using a real Chrome. Print-quality output, custom page sizes, margins, headers, footers.
- Real Chrome print pipeline — pixel-accurate, web-fonts-aware, paged-media compliant.
- Custom A4 / Letter / Legal / fully custom page sizes.
- Header/footer templates with date, page numbers, brand assets.
- Sync binary response or async signed-URL with webhook callback.
pdf.shcURL
curl -X POST https://api.browserforhire.com/pdf \
-H "Authorization: Bearer $BFH_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/invoice/123",
"format": "A4",
"margin": { "top": "20mm", "bottom": "20mm" },
"displayHeaderFooter": true,
"headerTemplate": "<div style=font-size:10px>Invoice #123</div>",
"footerTemplate": "<div style=font-size:10px><span class=pageNumber></span> / <span class=totalPages></span></div>"
}' \
--output invoice.pdfWhat you get
Print-quality output
Real Chrome rendering, embedded fonts, vector text where supported, raster fallback for canvas.
Full control
Custom CSS @page rules, header/footer HTML templates, page numbers, watermarks, attachments.
Bulk-friendly
POST a list of URLs and get a ZIP back. Or stream into your S3 bucket for downstream pipelines.
FAQ
Can I send raw HTML instead of a URL?+
Yes. POST { "html": "<html>...</html>" } and we render it through the same Chrome pipeline. Useful when your HTML never lives at a public URL.
Does this support web fonts and CSS variables?+
Yes. We render in real Chrome stable. Web fonts, CSS variables, container queries, custom @page rules — all supported.
Ship Chrome to production today.
Free 1,000 credits, no credit card. Drop-in replacement for Browserless.