PDF4.dev

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

  1. Design a template in the dashboard using HTML + CSS with {{variables}}
  2. Generate an API key in Settings
  3. Call the API with your template ID and data to get a PDF back
Generate a PDF
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.pdf

Key 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

Next steps