Skip to main content

Fill a PDF Form using n8n action

PDF4me Fill a PDF Form populates PDF form fields with structured data through n8n automation workflows. Process PDF forms via n8n triggers, binary data, base64 strings, or public URLs to automatically fill text fields, checkboxes, radio buttons, and dropdown menus using JSON data mapping with support for single document or batch processing modes. This solution is ideal for automated form completion, customer document generation, personalized forms, application processing, data population, and high-volume form workflows that require accurate field mapping with flexible data input and seamless integration.

Setup

Add the PDF4me "Fill a PDF Form" node to your n8n workflow and configure the required parameters. For initial setup instructions, see our n8n Integration Guide.

Prerequisites:

  • PDF4me API credentials
  • n8n workflow access

Configuration:

  1. Add PDF4me node to workflow
  2. Select "Fill a PDF Form" action
  3. Configure input parameters (see below)
Fill a PDF Form Configuration

Parameters

Complete list of parameters for the Fill a PDF Form action. Configure these parameters to control form data filling.

Important: Parameters marked with an asterisk (***) are required and must be provided for the action to function correctly.

ParameterTypeDescriptionExample
PDF Input Data Type***StringPDF Input Format Selection
• Choose the format of your PDF form template input
• PDF4me supports multiple input types
• Options: Binary Data, Base64 String, or URL
Binary Data
Input Binary FieldBinaryBinary PDF File Input (Required if Binary Data)
• Reference PDF file from previous n8n node or file upload
• Works with any PDF form template
• Required when PDF Input Data Type is "Binary Data"
{{ $binary.data }}
Base64 PDF ContentStringBase64 Encoded PDF Input (Required if Base64 String)
• Provide PDF content as base64 encoded string
• Supports various PDF form formats
• Required when PDF Input Data Type is "Base64 String"
JVBER...
PDF URLStringPublic PDF URL Input (Required if URL)
• Provide a public/open permission URL to the PDF form template
• Downloads and processes the form for data population
• Required when PDF Input Data Type is "URL"
https://abc.com/temp.pdf
Data Type***StringProcessing Mode Selection
• Choose between single document or batch processing
• Single Document: process one form at a time
• Batch Processing: handle multiple forms efficiently
Single Document
Form Data (JSON)***StringForm Field Data Mapping
• Provide structured JSON data with field names and values
• Field names must match PDF form field names exactly
• Essential for successful data mapping
{"name": "John", "email": "[email protected]"}
Output Type***StringOutput Format Specification
• Define the output format for the filled form
• Currently supports PDF format
• Maintains form structure and field properties
pdf
Input Data Type***StringInput Data Format
• Specify the format of the input data being provided
• Currently supports JSON format
• For structured data mapping to form fields
json
Output File Name***StringOutput Filename
• Specify the name for the generated filled PDF form
• Must include .pdf extension
• PDF4me ensures unique naming and format validation
filled_form_output.pdf
Output Binary Field Name***StringBinary Data Mapping
• Define the variable name for accessing generated filled PDF data
• Used in subsequent workflow actions
• Essential for workflow data flow
data
Meta DataStringAdditional Metadata
• Provide optional metadata information
• Can include processing timestamps, user information, custom identifiers
• Associated with the filled form for document tracking
Processing timestamp: 2024-01-15
Meta Data JSONStringStructured Metadata
• Provide structured metadata in JSON format
• Supports complex metadata structures for enterprise workflows
• Advanced document tracking and processing information
{"timestamp": "2024-01-15T10:30:00Z", "userId": "user123"}

Advanced Options

The following parameters are available in the Advanced Options section and are optional:

ParameterTypeDescriptionExample
Custom ProfilesStringCustom Configuration Profiles
• Set additional options using custom profiles
• JSON-like format containing predefined parameters
• Enables advanced form filling settings
• Optional for specialized requirements
{ "fieldValidation": true, "preserveFormatting": false }

Form Data Structure

JSON Data Format

The Form Data (JSON) parameter accepts structured data in JSON format where field names correspond to PDF form field names:

{
"fieldName1": "value1",
"fieldName2": "value2",
"fieldName3": "value3"
}

Field Mapping Guidelines

AspectDescriptionBest Practices
Field NamesMust exactly match PDF form field namesUse case-sensitive field names
Data TypesSupports strings, numbers, and booleansEnsure data type compatibility
Special CharactersEscape special characters in JSONUse proper JSON formatting

Output

Output Parameters

ParameterTypeDescriptionExample
fileNameStringPDF4me generated filename - The complete filename of the successfully processed filled PDF form with proper extension. PDF4me ensures unique naming and validates file format compliance for seamless integration with downstream processesfilled_form_output.pdf
mimeTypeStringPDF4me MIME type identifier - The standardized MIME type for the generated PDF file, always set to application/pdf by PDF4me's processing engine. This ensures proper file handling and recognition across all systems and applicationsapplication/pdf
fileSizeNumberPDF4me file size in bytes - The exact size of the generated filled PDF file in bytes, provided for storage planning, bandwidth optimization, and file transfer monitoring. Essential for enterprise document management and workflow automation139552
successBooleanPDF4me form filling status indicator - Boolean flag indicating the success or failure of the form filling process. Returns true for successful operations and false for any errors, enabling robust error handling in automated workflowstrue
messageStringPDF4me form filling status message - Descriptive message indicating the result of the form filling process. Provides clear status messages for successful operations and detailed error information for troubleshooting purposesPDF form filled successfully
dataTypeStringPDF4me processing mode confirmation - Confirms the processing mode that was used for form filling. Returns "single" for single document processing or "batch" for batch processing operations. This field helps verify the processing approach used during the operationsingle
formFieldsNumberPDF4me form field count - The total number of form fields that were successfully filled during the operation. This count provides confirmation of how many fields were processed and helps verify complete form population3

N8N Action Response

The PDF4me Fill a PDF Form API returns a response that can be viewed in multiple formats. Choose the view that best fits your needs:

JSON Response Format

The raw JSON response from the API:

[
{
"success": true,
"message": "PDF form filled successfully",
"fileName": "filled_form_output.pdf",
"mimeType": "application/pdf",
"fileSize": 139552,
"dataType": "single",
"formFields": 3
}
]

Use Cases

Document Automation and Personalization

  • Automatically populate customer information in PDF forms for personalized document generation
  • Fill registration forms, applications, and contracts with user-specific data
  • Generate personalized reports and documents with dynamic content injection

Business Process Automation

  • Streamline form completion workflows for customer onboarding and data collection
  • Automate invoice generation and contract processing with dynamic data mapping
  • Process bulk form filling for large-scale document operations

Integration and Workflow Enhancement

  • Connect form filling with CRM systems and databases for seamless data flow
  • Integrate with web applications and APIs for real-time form population
  • Enhance document processing pipelines with intelligent form completion

Get Help