Skip to main content

Fill a PDF Form in n8n

What this node does

PDF4me: Fill a PDF Form takes a fillable PDF (AcroForm) and populates its fields with your data in one n8n step. Provide the template as Binary Data, Base64, or URL and field values as a JSON object (JSON String, Binary, or Base64) or as Field Name / Field Value rows. Returns a completed PDF, either flattened (default) or with editable fields preserved. Ideal for filling applications, contracts, intake forms, or any AcroForm template from CRM, webhook, or spreadsheet data.

Related Blog Posts(1)

Authenticating Your API Request

Every PDF4me node in n8n requires a valid Credential to connect with. Create or select one that holds your PDF4me API key so the workflow can authenticate form-fill requests securely.

Important Facts You Should Not Miss

The PDF must already have AcroForm fields
This node fills existing form fields, it does not create them. A flat scan with no fields cannot be filled. Use Add Form Fields To PDF first if your template only has visual placeholders.
Keys must match AcroForm field names exactly
Field names are case-sensitive and often differ from the visible labels (firstname instead of First Name). Run Extract Form Data From PDF on the template first or inspect with Adobe Acrobat Prepare Form to get the exact list.
Form Data (JSON) expects one object, not a list
Send a single JSON object ({"firstname":"John","lastname":"Doe"}). An array with one object is unwrapped; multiple objects are rejected. To fill many PDFs in one run, wrap this node in a Loop Over Items.
Fill a PDF Form n8n node configured with Credential to connect with Pdf4me, Resource Forms, Forms Operations Fill a PDF Form, PDF Input Data Type Binary Data, PDF Binary Field data, Select Input Type Input Form Data, two sample Form Fields with Field Name First Name value shakti and Field Name Last Name value Karmakar, plus an Add Form Field button

Full node panel: PDF template via Binary Data + Input Form Data field rows

Parameters

Required in the n8n UI: Credential to connect with, PDF Input Data Type, Select Input Type, and (depending on Select Input Type) either Form Data Input Type with its matching content field, or at least one Form Fields row with Field Name and Field Value. Output File Name (default filled_form_output.pdf), Keep PDF Editable (off), and Binary Data Output Name (default data) are optional. Conditional template fields (PDF Binary Field, PDF Base64 Content, PDF URL) appear only when their input type is chosen.

ParameterRequiredWhat it doesExample
PDF Input Data TypeYesHow the PDF template enters the node. Binary Data reads from a previous node (default, most common). Base64 String accepts an encoded PDF. URL downloads the PDF from a public link.Binary Data
PDF Binary FieldConditionalName of the binary property on the incoming n8n item that holds the PDF. Required when PDF Input Data Type is Binary Data. Defaults to data.data
PDF Base64 ContentConditionalBase64-encoded PDF content. Required when PDF Input Data Type is Base64 String. Data-URL prefixes (data:application/pdf;base64,) are stripped automatically.JVBERi0xLjQK...
PDF URLConditionalPublicly reachable HTTPS URL to the PDF template. Required when PDF Input Data Type is URL. Must be a valid full URL format.https://example.com/application-form.pdf
Select Input TypeYesHow the field values are supplied. JSON sends a stringified JSON object via dataArray. Input Form Data adds one UI row per field with Field Name and Field Value.JSON
Form Data Input TypeConditionalHow the JSON object is supplied. Required when Select Input Type is JSON. JSON String pastes the object directly (default). Binary Data reads a JSON file from a previous node. Base64 String accepts an encoded JSON object.JSON String
Form Data (JSON)ConditionalRaw JSON object whose keys are PDF field names and values are what to fill. Required when Form Data Input Type is JSON String. Must be a single object, not a list.{"firstname":"John","lastname":"Doe","email":"[email protected]"}
Form Data Binary FieldConditionalName of the binary property on the incoming n8n item that holds the JSON data file. Required when Form Data Input Type is Binary Data. Defaults to data.data
Form Data Base64 ContentConditionalBase64-encoded UTF-8 JSON object. Required when Form Data Input Type is Base64 String. Decoded then stringified into dataArray.eyJmaXJzdG5hbWUiOiJKb2huIn0=
Form FieldsConditionalCollection of field rows. Required when Select Input Type is Input Form Data. Add at least one row via Add Form Field. The node errors if the list is empty.[{Field Name: firstname, Field Value: John}]
Field Name (per row)ConditionalExact AcroForm field name to fill. Required for every row added to Form Fields.firstname
Field Value (per row)ConditionalValue to fill into the matching AcroForm field. Required for every row added to Form Fields.John
Output File NameNoFilename of the filled PDF returned by the node. Default is filled_form_output.pdf. Include the .pdf extension.filled_form_output.pdf
Keep PDF EditableNoToggle to keep AcroForm fields editable on the filled PDF. Off (default) flattens the form into static text. On preserves field definitions so the recipient can re-edit.Off
Binary Data Output NameNoName of the binary property the output item exposes. Default is data. Use a different name when a downstream node expects it.data

PDF Input Data Type Options

Pick how the PDF template enters the node. The follow-up fields change with this choice.

PDF Input Data Type dropdown in n8n PDF4me Fill a PDF Form node showing three options: Binary Data highlighted with description Use PDF file from previous node, Base64 String with description Provide PDF content as base64 encoded string, URL with description Provide URL to PDF file

PDF Input Data Type: Binary Data, Base64 String, or URL

Binary DataDefault: PDF from previous node
Reads the PDF directly from a prior node such as Google Drive Download, HTTP Request, or Read Binary File. Set PDF Binary Field to the binary field name (default data).
Base64 StringPDF as a base64 string
Paste or map a base64 string into PDF Base64 Content. Data-URL style prefixes (data:application/pdf;base64,) are stripped automatically.
URLDownload from a public link
Provide a full HTTPS URL in PDF URL. PDF4me fetches the template directly. The URL must be valid and reachable without authentication.

Select Input Type Options

Pick how the field values are supplied. The follow-up fields change with this choice.

Select Input Type dropdown in n8n PDF4me Fill a PDF Form node showing two options: JSON with description Send form data as a stringified JSON object in dataArray and Input Form Data highlighted with description Send form data as an array of field name value pairs

Select Input Type: JSON (for dataArray) or Input Form Data (UI rows)

JSONBest for many fields and dynamic data
Sends one stringified JSON object via the API dataArray field. Keys are PDF field names, values are what to fill. Add a follow-up Form Data Input Type choice (JSON String, Binary Data, or Base64 String) to supply the object.
Input Form DataBest for small fixed sets configured in the UI
Add one row per field via Add Form Field. Each row has a Field Name (exact AcroForm name) and Field Value. The node errors if the list is empty.

Form Data Input Type Options (when Select Input Type is JSON)

Form Data Input Type dropdown in n8n PDF4me Fill a PDF Form node when Select Input Type is JSON, showing three options: JSON String highlighted with description Provide JSON content as text or object, Binary Data with description Use JSON file from previous node, Base64 String with description Provide JSON content as base64 encoded string

Form Data Input Type: JSON String, Binary Data, or Base64 String

JSON StringDefault: paste or map JSON inline
Type the object directly into Form Data (JSON) or map it from a previous node expression. The most common pick for CRM-driven or webhook-driven workflows.
Binary DataJSON file from a previous node
Set Form Data Binary Field to the binary field name (default data). Use this when the JSON arrives as a downloaded file. The file must contain a single object.
Base64 StringBase64-encoded JSON object
Provide the UTF-8 JSON object as base64 in Form Data Base64 Content. The node decodes and stringifies it into dataArray.

Form Data (JSON) example

When Form Data Input Type is JSON String, paste a single object whose keys are exact AcroForm field names.

Form Data Input Type set to JSON String with Form Data (JSON) editor showing a single inline JSON object firstname John lastname Doe email john at example dot com, followed by Output File Name filled_form_output.pdf

JSON String input: one object, keys match AcroForm field names exactly

{
"firstname": "John",
"lastname": "Doe",
"email": "[email protected]"
}

Output Fields

A successful run returns one n8n item carrying JSON metadata and the filled PDF.

FieldTypeWhat it contains
successBooleanTrue when the PDF was filled successfully. Use to route error-handling branches.
messageStringHuman-readable status confirming success or describing an error.
fileNameStringFilename of the filled PDF, set from Output File Name (default filled_form_output.pdf).
mimeTypeStringMIME type of the filled file, application/pdf.
fileSizeNumberSize of the filled PDF in bytes.
inputModeStringWhich input mode was used: json or inputFormData.
fieldCountNumberHow many form fields were sent in this request.
Binary (data)BinaryThe filled PDF under Binary Data Output Name (default data). Pass into Write Binary File, Email, or any cloud-storage upload.

Quick Setup

  1. Add PDF4me to your n8n workflow. Set Resource to Forms and Forms Operations to Fill a PDF Form.
  2. In Credential to connect with, select your PDF4me credential or click Create New Credential and paste your API key.
  3. Set PDF Input Data Type to Binary Data (default), Base64 String, or URL and fill the matching field (PDF Binary Field, PDF Base64 Content, or PDF URL).
  4. Set Select Input Type to JSON (then choose Form Data Input Type = JSON String / Binary Data / Base64 String and supply the object) or Input Form Data (click Add Form Field and add one row per field with Field Name and Field Value).
  5. Make sure every Field Name matches an AcroForm field name in the template exactly (case-sensitive). Use Extract Form Data From PDF first if you are unsure.
  6. Optionally change Output File Name from the default filled_form_output.pdf.
  7. Toggle Keep PDF Editable on only if the recipient should be able to re-edit the filled fields. Default off flattens the form.
  8. Leave Binary Data Output Name as data unless a downstream node needs a different property name. Execute the node and route the filled PDF into Write Binary File, Email, or cloud storage.

Typical Setups

Workflow ExamplesCommon n8n workflow patterns using Fill a PDF Form.
File. fill. save: PDF template from Drive, values inline
  1. A Google Drive Download node pulls the application form PDF template (Binary Data, property data).
  2. PDF4me Fill a PDF Form runs with PDF Input Data Type Binary Data, Select Input Type JSON, Form Data Input Type JSON String. Form Data (JSON) is a single inline object.
  3. A Write Binary File node saves the filled PDF to a network folder using $json.fileName.
Values from a prior node mapped with expressions
  1. A webhook receives a form-submission payload from a website.
  2. PDF4me Fill a PDF Form is configured with Select Input Type JSON, Form Data Input Type JSON String. Form Data (JSON) is an n8n expression that maps the webhook payload directly into the AcroForm field shape ({{ { firstname: $json.first, lastname: $json.last } }).
  3. A Gmail node emails the filled PDF back to the submitter as an attachment.
Few fields, no JSON: Input Form Data rows
  1. An intake form has only three AcroForm fields: firstname, lastname, email.
  2. PDF4me Fill a PDF Form is set with Select Input Type Input Form Data. Three rows are added via Add Form Field with the exact field names and the values typed or expression-mapped.
  3. Keep PDF Editable is off so the filled form is flattened.
  4. The PDF is uploaded to a SharePoint document library.
PDF and JSON as separate files, merged in n8n
  1. One node downloads the PDF template; another node downloads the JSON data file. A Merge node combines them onto one item.
  2. PDF4me Fill a PDF Form is configured with PDF Input Data Type Binary Data (PDF Binary Field set to the PDF field name) and Select Input Type JSON, Form Data Input Type Binary Data (Form Data Binary Field set to the JSON field name).
  3. The filled PDF is saved with the order ID as filename.
Editable filled PDF for a recipient to complete
  1. A CRM update fires the workflow when a new customer is created.
  2. PDF4me Fill a PDF Form pre-fills the customer-known fields on an onboarding form (name, email, account_id) using Select Input Type JSON.
  3. Keep PDF Editable is turned on so the customer can complete the remaining optional fields.
  4. An Outlook node emails the pre-filled editable PDF with a deadline reminder.

Practical Tips

Wrong field names are the #1 cause of empty output
Run Extract Form Data From PDF on the template first to get the exact list. Names are case-sensitive and usually have no spaces (firstname, not First Name).
"No binary data found" errors
Double-check PDF Binary Field and Form Data Binary Field names. The Merge node in a fan-in workflow can rename binary properties.
Prefer JSON for many or dynamic fields
Input Form Data is great for 2-3 hardcoded fields, but JSON scales better and works naturally with expressions from previous nodes.
Keep PDF Editable only when needed
Default off flattens the form, which is the right choice when the filled PDF is a final record. Turn on only when the recipient needs to add or change values.
Form Data (JSON) is one object only
Send a single object, not an array of records. An array of one is unwrapped; multiple objects fail. To fill many PDFs in one run, wrap this node in Loop Over Items.
No AcroForm fields means nothing to fill
A flat scan with no fields cannot be filled. Use Add Form Fields To PDF first to add fillable fields before calling Fill a PDF Form.

Cheat Sheet

FieldValue
ResourceForms
OperationFill a PDF Form
PDF Input Data TypeBinary Data
PDF Binary Fielddata
Select Input TypeJSON
Form Data Input TypeJSON String
Form Data (JSON){"firstname":"John","lastname":"Doe","email":"[email protected]"}
Output File Namefilled_form_output.pdf
Keep PDF EditableOff
Binary Data Output Namedata
CredentialsPDF4me API credential

Frequently Asked Questions

What is the difference between JSON and Input Form Data?+
JSON sends one stringified object via the API dataArray field. Keys are PDF field names and values are what to fill. Best for many fields, dynamic data mapped from previous nodes, or workflows that already produce JSON. Input Form Data adds one UI row per field with Field Name and Field Value. Best for a small fixed set of fields configured manually in the n8n editor.
How do I know the exact AcroForm field names?+
Run PDF4me Extract Form Data From PDF on the template first. The output is the exact list of field names you can use as keys in Form Data (JSON) or as Field Name rows in Input Form Data. Or inspect the PDF in Adobe Acrobat (Prepare Form) and read the field names from the properties panel. Field names are case-sensitive.
What does Keep PDF Editable do?+
Off (default) flattens the form into static text in the output PDF. Useful when the filled PDF is a final, locked record of what was submitted. On preserves AcroForm field definitions in the output so the recipient can re-edit values in any PDF viewer. Turn it on only when the recipient needs to add or change values after automation.
Can I send an array of multiple objects in Form Data (JSON)?+
No. The node expects a single object. An array containing one object is unwrapped automatically as a convenience. Arrays of multiple objects are rejected. To fill many PDFs in one execution, wrap this node in a Loop Over Items and call it once per object.
Why are some fields blank in the output PDF?+
Almost always because the keys you sent did not match the AcroForm field names exactly. Field names are case-sensitive and often have no spaces or capital letters (firstname instead of First Name). Confirm the exact names with Extract Form Data From PDF before mapping your data.
What happens with a flat PDF that has no form fields?+
Nothing fills. This node populates existing AcroForm fields; it does not create them. For a flat scan or a PDF with visual placeholders only, run Add Form Fields To PDF first to add fillable fields, then call Fill a PDF Form.
How do I send the PDF as base64 with a data: prefix?+
The node strips data-URL prefixes (data:application/pdf;base64,) automatically when you paste them into PDF Base64 Content, so it works either way.
Can I get a non-PDF output (e.g. PNG of the filled form)?+
No. This endpoint outputs PDF only. To rasterize the filled PDF into PNG or JPEG, chain a downstream PDF4me Convert PDF to Image action after Fill a PDF Form.

Same Task on Other Platforms

Get Help