Flatten PDF using n8n action
PDF4me Flatten PDF converts interactive PDF elements into static, non-editable content through n8n automation workflows. Process PDFs via n8n triggers, binary data, base64 strings, or public URLs to flatten form fields, annotations, comments, layers, markups, and interactive elements into permanent content while preserving visual appearance, text quality, and document structure. This solution is ideal for document finalization, archival workflows, form submission processing, secure document distribution, compliance documentation, and preventing unauthorized edits that require non-editable PDF output with preserved formatting and seamless integration.
Setup
Add the PDF4me "Flatten PDF" 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:
- Add PDF4me node to workflow
- Select "Flatten PDF" action
- Configure input parameters (see below)

Parameters
Complete list of parameters for the Flatten PDF action. Configure these parameters to control PDF flattening.
Important: Parameters marked with an asterisk (***) are required and must be provided for the action to function correctly.
| Parameter | Type | Description | Example |
|---|---|---|---|
| Input Data Type*** | String | PDF Input Format Selection • Choose the format of your PDF data input • PDF4me supports multiple input types • Options: Binary Data, Base64 String, or URL | Binary Data |
| Input Binary Field | Binary | Binary PDF File Input (Required if Binary Data) • Reference PDF file from previous n8n node or file upload • PDF4me processes binary PDF files with automatic format detection • Required when Input Data Type is "Binary Data" | {{ $binary.data }} |
| Base64 Document Content | String | Base64 Encoded PDF Input (Required if Base64 String) • Provide PDF data as base64 encoded string • PDF4me automatically decodes and processes the PDF content • Required when Input Data Type is "Base64 String" | UEsDBBQABgAI... |
| File URL | String | Public PDF URL Input (Required if URL) • Provide a public/open permission URL to the PDF file • PDF4me downloads and processes the file from URL • Required when Input Data Type is "URL" | https://abc.com/sample.pdf |
| Output File Name*** | String | Flattened PDF Output Filename • Specify the name for the generated flattened PDF file • Must include .pdf extension • PDF4me ensures unique naming and format validation | flattened_document.pdf |
| Document Name*** | String | Source PDF Reference • Specify the name of the source PDF file • For reference and tracking purposes • Helps with processing tracking | document.pdf |
Flattening Options
The following parameters are available in the Flattening Options section and are optional:
| Parameter | Type | Description | Example |
|---|---|---|---|
| Flatten Forms | Boolean | Form Flattening Control • Control whether interactive form fields should be flattened • true = converts all form fields to non-editable text • false = preserves form field interactivity • Useful for finalizing filled forms | true |
| Flatten Annotations | Boolean | Annotation Flattening Control • Control whether PDF annotations should be flattened • true = merges annotations with page content • false = preserves annotation interactivity • Useful for comment preservation | true |
| Flatten Layers | Boolean | Layer Flattening Control • Control whether PDF layers should be flattened into single layer • true = combines all visible layers into one • false = preserves layer structure • Useful for layer consolidation | true |
| Flatten Digital Signatures | Boolean | Signature Flattening Control • Control whether digital signatures should be flattened • true = converts signatures to static images • false = preserves signature validity and interactivity • Default is false to maintain signatures | false |
| Flatten Interactive Elements | Boolean | Interactive Element Flattening • Control whether all interactive elements should be flattened • true = eliminates all interactive functionality • false = preserves some interactive elements • Useful for static document creation | true |
Advanced Options
The following parameters are available in the Advanced Options section and are optional:
| Parameter | Type | Description | Example |
|---|---|---|---|
| Custom Profiles | String | Custom Configuration Profiles • Set additional options using custom profiles • JSON-like format containing predefined parameters • Enables advanced PDF flattening settings • Optional for specialized requirements | { "outputDataFormat": "base64", "preserveMetadata": true } |
Output
Output Parameters
| Parameter | Type | Description | Example |
|---|---|---|---|
| success | Boolean | PDF4me flattening status indicator - Boolean flag indicating the success or failure of the PDF flattening process. PDF4me returns true for successful flattening and false for any errors, enabling robust error handling in automated workflows | true |
| message | String | PDF4me flattening status message - Human-readable status message providing details about the flattening process result. Includes success confirmation or error details for troubleshooting | PDF flattening completed successfully |
| fileName | String | PDF4me generated flattened PDF filename - The complete filename of the successfully generated flattened PDF document with proper .pdf extension. PDF4me ensures unique naming and validates file format compliance for seamless integration with downstream processes | flattened_document.pdf |
| mimeType | String | PDF4me flattened PDF MIME type - The MIME type of the generated flattened PDF file, indicating the file format for proper handling in web applications and file systems | application/pdf |
| fileSize | Number | PDF4me flattened PDF file size in bytes - The exact size of the generated flattened PDF file in bytes, provided by PDF4me for storage planning, bandwidth optimization, and file transfer monitoring. Essential for enterprise document management and workflow automation | 24846 |
| originalFileName | String | PDF4me source PDF reference - The original PDF filename that was processed by PDF4me's flattening engine. This reference is maintained for audit trails, debugging purposes, and tracking the source of generated flattened documents in enterprise workflows | document.pdf |
| flattenedElements | Array | PDF4me flattened elements list - Array of strings indicating which types of interactive elements were successfully flattened during the process. Shows the specific elements that were converted to static content | ["forms", "annotations", "layers", "digital signatures", "interactive elements"] |
| description | String | PDF4me flattening process description - Detailed description of the flattening process result, providing additional context about what was accomplished during the PDF flattening operation | All interactive elements have been converted to static content |
N8N Action Response
The PDF4me Flatten PDF API returns a response that can be viewed in multiple formats. Choose the view that best fits your needs:
- JSON
- Table
- Schema
- Binary
JSON Response Format
The raw JSON response from the API:
{
"success": true,
"message": "PDF flattening completed successfully",
"fileName": "flattened_document.pdf",
"mimeType": "application/pdf",
"fileSize": 24846,
"originalFileName": "document.pdf",
"flattenedElements": [
"forms",
"annotations",
"layers",
"digital signatures",
"interactive elements"
],
"description": "All interactive elements have been converted to static content"
}
Table View
Response data in a structured table format:
| Parameter | Value |
|---|---|
| success | true |
| message | PDF flattening completed successfully |
| fileName | flattened_document.pdf |
| mimeType | application/pdf |
| fileSize | 24846 |
| originalFileName | document.pdf |
| flattenedElements | ["forms", "annotations", "layers", "digital signatures", "interactive elements"] |
| description | All interactive elements have been converted to static content |
Schema View
The data structure and types of the response:
1 item
success: ☑ true
message: AB PDF flattening completed successfully
fileName: AB flattened_document.pdf
mimeType: AB application/pdf
fileSize: # 24846
originalFileName: AB document.pdf
flattenedElements: [] forms, annotations, layers, digital signatures, interactive elements
description: AB All interactive elements have been converted to static content
Type Indicators:
AB= String#= Number☑= Boolean
Binary Data View
The actual flattened PDF file data and metadata:
data
─────────────────────────────
File Name: flattened_document.pdf
File Extension: pdf
Mime Type: application/pdf
File Size: 240.0 KB
Binary Data Access:
- n8n Binary Object:
$binary.data.data - Base64 Content: Available for direct use
- File Operations: Ready for download, email, or storage
Use Cases
Document Security and Finalization
- Flatten PDF documents with form fields, annotations, and interactive elements to create final, non-editable versions for distribution, archiving, and legal documentation
- Process contracts, agreements, and legal documents by flattening them to prevent unauthorized modifications, ensure document integrity, and maintain legal validity
- Transform editable PDF forms and templates to flattened versions for final submission, official documentation, and compliance with regulatory requirements
Print and Distribution Preparation
- Flatten PDF documents with layers, comments, and interactive elements to prepare them for printing, physical distribution, and offline access
- Process marketing materials, brochures, and promotional documents by flattening them to ensure consistent appearance across different devices and printing systems
- Transform interactive PDF presentations and reports to flattened versions for formal distribution, client presentations, and stakeholder communications
Compliance and Regulatory Documentation
- Flatten PDF documents with form data, signatures, and annotations to create final, compliant versions for regulatory submissions, audit trails, and official documentation
- Process financial reports, compliance documents, and regulatory filings by flattening them to ensure data integrity, prevent tampering, and meet regulatory standards
- Transform editable PDF forms and applications to flattened versions for final submission, official processing, and regulatory compliance