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 "Repair PDF Document" operation that allows users to fix corrupted or damaged PDF files. This is useful when PDFs are not opening correctly, have structural issues, or contain errors that prevent normal usage. The node supports multiple input methods for the PDF file: binary data from a previous node, a base64 encoded string, or a URL pointing to the PDF.

Common scenarios include:

  • Automatically repairing PDFs received from external sources before further processing.
  • Fixing PDFs generated by other systems that may be partially corrupted.
  • Preparing PDFs for archival or distribution by ensuring they are structurally sound.

Example use case:

  • A workflow downloads a PDF report from a URL, repairs it if corrupted, and then sends the repaired version via email or stores it in cloud storage.

Properties

Name Meaning
Input Data Type Choose how to provide the PDF file to repair. Options: Binary Data (from previous node), Base64 String, URL to PDF file.
Input Binary Field Name of the binary property containing the PDF file (used only if Input Data Type is Binary Data).
Base64 PDF Content Base64 encoded content of the PDF file (used only if Input Data Type is Base64 String).
PDF URL URL to the PDF file to repair (used only if Input Data Type is URL).
Output File Name Name for the output repaired PDF file. Default is "repaired.pdf".
Async Enable asynchronous processing (boolean).
Binary Data Output Name Custom name for the binary data field in the node's output. Default is "data".

Output

The node outputs the repaired PDF file as binary data under the specified binary data output name (default "data"). The JSON output contains metadata about the processed item, but the main content is the repaired PDF binary data ready for downstream nodes.

If asynchronous processing is enabled, the node handles the repair operation without blocking, suitable for large files or slow operations.

Dependencies

  • Requires an API key credential for the PDF repair service (generic API authentication token).
  • Needs network access if using URL input type.
  • No additional environment variables are explicitly required beyond standard n8n credentials setup.

Troubleshooting

  • Common Issues:

    • Providing incorrect binary property name when using binary input will cause the node to fail to find the PDF file.
    • Invalid base64 string input can lead to decoding errors.
    • URL input must point to a valid accessible PDF file; otherwise, download or repair will fail.
    • Large PDF files might require asynchronous mode to avoid timeouts.
  • Error Messages:

    • Errors related to missing or invalid input data typically indicate misconfiguration of input properties.
    • Network errors when using URL input suggest connectivity or permission issues.
    • API authentication errors mean the provided API key credential is invalid or missing.
  • Resolutions:

    • Double-check the input data type and corresponding fields.
    • Validate base64 strings with external tools before use.
    • Ensure URLs are publicly accessible or properly authenticated.
    • Enable asynchronous processing for large files.

Links and References

Discussion