PDF4me icon

PDF4me

Comprehensive PDF and document processing: generate barcodes, convert files, extract data, manipulate images, and automate workflows with the PDF4ME API

Actions80

Overview

The node provides a "Flatten PDF" operation that processes PDF files to convert interactive and layered elements into static content. Flattening a PDF is useful when you want to ensure the document's appearance remains consistent and uneditable, such as finalizing forms, annotations, signatures, or interactive elements before distribution or archiving.

Common scenarios include:

  • Converting fillable form fields into plain text so recipients cannot modify them.
  • Making annotations and comments permanent parts of the document.
  • Merging multiple layers into one for simpler viewing or printing.
  • Rendering digital signatures visually without retaining their interactive properties.
  • Disabling buttons, links, and other interactive features by converting them to static content.

Practical example: A company collects filled PDF forms from clients and wants to lock the data by flattening the forms and annotations before storing or sharing the documents.

Properties

Name Meaning
Input Data Type Choose how to provide the PDF file to flatten:
- Binary Data: Use PDF file from previous node
- Base64 String: Provide PDF content as base64 encoded string
- URL: Provide URL to PDF file
Input Binary Field Name of the binary property containing the PDF file (used if Input Data Type is Binary Data)
Base64 PDF Content Base64 encoded PDF document content (used if Input Data Type is Base64 String)
PDF URL URL to the PDF file to flatten (used if Input Data Type is URL)
Output File Name Name for the output flattened PDF file (e.g., "flattened_document.pdf")
Document Name Name of the source PDF file for reference (e.g., "document.pdf")
Flattening Options Collection of boolean options controlling what elements to flatten:
- Flatten Forms: Convert form fields to static text
- Flatten Annotations: Convert annotations to permanent marks
- Flatten Layers: Merge all layers
- Flatten Digital Signatures: Convert digital signatures to visual representation only
- Flatten Interactive Elements: Convert buttons, links, and other interactive elements to static content
Advanced Options Additional optional settings:
- Custom Profiles: JSON string to adjust custom properties for API calls (see external profiles documentation)
- Use Async Processing: Whether to use asynchronous processing (recommended for large files)

Output

The node outputs the flattened PDF file in binary format under the standard binary property with the specified output file name. The json output contains metadata about the processed file, typically including the filename and possibly other relevant information.

If the input was provided as binary data, base64 string, or URL, the output will be the flattened PDF file ready for further use or download.

Dependencies

  • Requires an external PDF processing service accessible via API to perform the flattening operation.
  • Needs an API key or authentication token configured in n8n credentials to authorize requests to the PDF processing service.
  • Optional advanced configuration can be done using custom JSON profiles referencing the external service's profile documentation.

Troubleshooting

  • Common issues:
    • Providing an invalid or inaccessible PDF URL will cause errors fetching the file.
    • Incorrect base64 encoding or corrupted binary data input may result in processing failures.
    • Large PDF files might time out or fail if asynchronous processing is not enabled.
  • Error messages:
    • Errors related to authentication indicate missing or invalid API credentials.
    • File format errors suggest the input is not a valid PDF.
    • Timeout or processing errors can often be resolved by enabling asynchronous processing in advanced options.

Links and References

Discussion