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.
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.
Three steps between your data and a finished PDF.
Write HTML with {{variables}} where dynamic data goes. Use the visual editor or code editor with live preview.
POST your template ID and a JSON object. Handlebars replaces each variable with your data.
The API returns a PDF binary, rendered by headless Chromium in ~3ms. Use it from any language.
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.
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.
PDF4.dev is built and operated by benoitded, a software engineer based in France. One person, one product, no VC, no committee.
Free to start. Read the docs, create a template, render your first PDF in under a minute.