We use cookies

We use cookies to enhance your experience and analyse site usage.

Back to Blog
Update4 min read

Introducing HTMLPDF.dev: HTML to PDF in One API Call

Generate pixel-perfect PDFs from HTML or any URL with a single POST request. No infrastructure, no complexity — just an API key and your HTML.

Why we built HTMLPDF.dev

Generating PDFs from HTML should be simple. It isn't.

If you've tried to do it yourself, you've likely hit the same wall: installing Puppeteer or Playwright, managing a Chromium binary, dealing with memory leaks, handling timeouts, and debugging why your CSS looks perfect in the browser but broken in the PDF. Then multiply that by every language, every framework, every deployment environment.

We built HTMLPDF.dev to make this a solved problem. One API endpoint. Your HTML goes in, a PDF comes out.

How it works

HTMLPDF.dev runs a pool of headless Chromium instances. When you POST your HTML (or a URL), we:

1. Route your request to an available browser

2. Render the page at full resolution

3. Apply your layout options (format, margins, scale, etc.)

4. Return a pixel-perfect PDF

The whole thing typically completes in under 500ms for simple documents.

Your first PDF

Sign up, grab your API key from the dashboard, and run this:

curl -X POST https://api.htmlpdf.dev/api/pdf \

-H "Authorization: Bearer YOUR_API_KEY" \

-H "Content-Type: application/json" \

-d '{"html": "<h1>Invoice #1042</h1><p>Total: $249</p>", "format": "A4"}' \

--output invoice.pdf

That's it. Your PDF is in invoice.pdf.

Two input modes

HTML mode is best for template-based generation. Pass your pre-rendered HTML string — invoices, reports, certificates, any document you build server-side. URL mode captures any publicly accessible page. Great for archiving, visual snapshots, or generating PDFs from pages you can't easily serialize to HTML.

Free tier

100 PDFs per month, forever free. No credit card required. Start building today and upgrade when you're ready to scale.

Get your free API key →

Ready to get started?

Create a free account and generate your first PDF in under 2 minutes.

Get started free