Introduction
PDF4.dev is a PDF generation service. Create HTML templates with Handlebars variables, preview them live, and render PDFs via REST API from any language.
How it works
- Design a template in the dashboard using HTML + CSS with
{{variables}} - Generate an API key in Settings
- Call the API with your template ID and data to get a PDF back
curl -X POST https://pdf4.dev/api/v1/render \
-H "Authorization: Bearer p4_live_xxx" \
-H "Content-Type: application/json" \
-d '{"template_id": "invoice", "data": {"company": "Acme"}}' \
--output invoice.pdfKey features
- HTML + CSS templates: full control over layout and styling
- Handlebars variables:
{{variable_name}}syntax for dynamic data - 6 page presets: A4, Letter, landscape variants, square, and custom sizes
- Live preview: see your PDF in real time as you edit
- REST API: simple POST request, get a PDF back
- AI-native: MCP server for Claude, ChatGPT, Cursor, and more