Package Information
Available Nodes
Documentation generating…
Documentation
n8n-nodes-pdf4
This is an n8n community node that lets you generate PDFs from HTML templates using PDF4.dev.
PDF4.dev is a developer-first PDF generation API. Create HTML templates with Handlebars variables, preview them live, and render PDFs via REST. Think Resend, but for PDFs.
Installation · Operations · Credentials · Compatibility · Usage · Resources
Installation
Follow the installation guide in the n8n community nodes documentation.
Name: n8n-nodes-pdf4
On self-hosted n8n: Settings → Community Nodes → Install → paste the package name.
Operations
- Render From Template — generate a PDF from a saved template with variable data. Works by ID (
tmpl_...) or by slug. - Render From HTML — generate a PDF from raw HTML without creating a template first. Handlebars variables supported.
Both operations return the PDF either as a binary property (ready to attach, email, or upload downstream) or as a base64 string.
Template
- List — list all templates in your PDF4.dev account.
- Get — fetch a single template by ID or slug.
Format overrides
Every PDF operation accepts optional format overrides (preset, custom width/height) that override the template's default format at render time.
Credentials
- Sign up at pdf4.dev (free tier available)
- Go to Dashboard → Settings → API Keys
- Create a key (starts with
p4_live_) - In n8n, create a new PDF4.dev API credential and paste the key
The Base URL field only needs to be changed for self-hosted PDF4.dev instances. Leave it as https://pdf4.dev for the hosted service.
Compatibility
- n8n v1.0 or later
- Node.js 20.15+
Tested against PDF4.dev API v1.
Usage
Invoice from Airtable record
- Airtable Trigger — on new record in
Invoices - PDF4.dev — Render From Template
- Template ID:
invoice - Data:
{{ { customer: $json.customer, total: $json.total, items: $json.items } }}
- Template ID:
- Gmail — send email with the PDF as attachment (use the binary property from step 2)
Certificate from form submission
- Typeform Trigger — on form submission
- PDF4.dev — Render From Template
- Template ID:
certificate - Data:
{{ { name: $json.name, course: $json.course, date: $now.toISO() } }}
- Template ID:
- Google Drive — upload the binary PDF
Raw HTML quick render
Use Render From HTML when you want to ship a one-off PDF without creating a template in the dashboard. Write your HTML inline (<h1>Hello {{name}}</h1>) and pass a JSON data object.