Get started

HTML in, pixel-perfect PDFs out

PDF4.dev is a PDF generation API for developers who already know HTML and CSS. Write a template, send data, get a PDF back. No proprietary markup, no Docker containers, no page-level billing.

~3msRender time per PDF (warm browser pool)
200+Ready-to-use templates across 64 industries
14Free browser-based PDF tools
14MCP tools for AI agents
1POST request to generate a PDF
0Proprietary syntax to learn

Why PDF4.dev exists

Generating PDFs programmatically has been possible for years. The developer experience around it has not kept up. Most tools force you to manage headless browsers yourself, learn proprietary template languages, or accept per-page pricing that gets expensive fast.

PDF4.dev takes a different approach: you write standard HTML and CSS (the skills you already have), use Handlebars for dynamic data, and get back a PDF rendered by a real browser engine. The same CSS that works in Chrome works in your PDF. Flexbox, grid, web fonts, media queries for print: all supported, because the renderer is Chromium.

How it works

Three steps between your data and a finished PDF.

1

Create a template

Write HTML with {{variables}} where dynamic data goes. Use the visual editor or code editor with live preview.

2

Send data via API

POST your template ID and a JSON object. Handlebars replaces each variable with your data.

3

Get a PDF back

The API returns a PDF binary, rendered by headless Chromium in ~3ms. Use it from any language.

Under the hood

PDF4.dev runs Playwright with headless Chromium. Your HTML is compiled with Handlebars (variables, loops, conditionals, built-in helpers for dates, numbers, and currency), loaded into a browser page, and printed to PDF. Headers and footers repeat on every page using the CSS 2.1 paged media table trick. The full API is documented as an OpenAPI 3.1 spec.

AI-native from day one

PDF4.dev implements the Model Context Protocol (MCP) with 14 tools. AI agents like Claude, ChatGPT, Cursor, and Windsurf can create templates, render PDFs, and manage components directly. Machine-readable docs are published at standard paths so any agent can find them.

Who built this

PDF4.dev is built and operated by benoitded, a software engineer based in France. One person, one product, no VC, no committee.

Contact

Start generating PDFs

Free to start. Read the docs, create a template, render your first PDF in under a minute.