Every SaaS eventually needs to generate PDFs — invoices, reports, receipts, certificates. And every team that tries the DIY route hits the same wall: PDF libraries that mangle CSS, headless browsers that eat server memory, font rendering that differs between dev and production.
You already know how to build beautiful documents — with HTML and CSS. An HTML-to-PDF API lets you keep doing exactly that:
curl -X POST https://pdfhub.surf-api.com/api/v1/convert \
-H "Authorization: Bearer ph_live_..." \
-H "Content-Type: application/json" \
-d '{"source": "<h1>Invoice #881</h1>", "filename": "invoice-881.pdf"}' \
--output invoice-881.pdf
One POST request. The response body is the PDF.
PDFHub renders with real headless Chromium — the same engine as Chrome. CSS Grid, Flexbox, web fonts, SVG charts: if it looks right in your browser, it looks right in the PDF. Cheaper APIs built on wkhtmltopdf run a 2015-era engine where modern CSS quietly breaks.
You can also pass a URL instead of raw HTML, control page size (A4, Letter…), orientation, margins, and add a JS-rendering delay for SPA pages.
Failed conversions never count against your quota. Get a key in 30 seconds at the dashboard, full reference at /developers.
No signup, no watermark, files deleted after 24h.