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 operation Get Document From Pdf4me processes a PDF file to extract or split documents based on barcode information. It is designed to handle PDFs provided in various formats (binary data, base64 string, or URL) and searches for specific barcodes within the document. The node can split the PDF at pages where the barcode matches certain criteria, optionally combining consecutive pages with the same barcode. This functionality is useful in scenarios such as automated document processing, invoice or form separation, and batch splitting of scanned documents by barcode markers.

Practical examples:

  • Splitting a large scanned PDF containing multiple invoices separated by QR codes into individual invoice files.
  • Extracting sections of a PDF report based on barcode identifiers embedded in the pages.
  • Automating document workflows where barcodes indicate document boundaries or categories.

Properties

Name Meaning
Input Data Type How the PDF file is provided:
- Binary Data (from previous node)
- Base64 String (encoded PDF content)
- URL (link to the 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 string of the PDF content (used if Input Data Type is Base64 String)
PDF URL URL pointing to the PDF file to process (used if Input Data Type is URL)
Barcode String The barcode string to search for within the PDF pages
Barcode Filter Filter type for matching the barcode string:
- Starts With
- Contains
- Equals
Barcode Type Type of barcode to look for:
- QR Code
- Code 128
- Code 39
Split Barcode Page Where to split the PDF relative to the barcode page:
- Before
- After
Combine Pages With Same Consecutive Barcodes Whether to combine pages that have the same consecutive barcode value into one output document
PDF Render DPI Dots per inch setting for rendering the PDF during processing (affects quality/resolution)
Output File Name Name of the output ZIP file that will contain the resulting split PDF documents
Async Enable asynchronous processing mode (true/false)

Output

The node outputs a ZIP archive containing the split PDF documents based on the barcode detection and splitting rules. The json output field includes metadata about the processed documents and references to the binary data representing the split PDFs inside the ZIP file.

If the input was binary or URL-based, the output contains the extracted PDF parts packaged together. The node may also output binary data fields corresponding to the generated ZIP file.

Dependencies

  • Requires an active connection to the Pdf4me API service for PDF processing.
  • Needs appropriate API authentication credentials configured in n8n to authorize requests.
  • Internet access is required if providing PDF via URL or for API communication.
  • No additional local dependencies are indicated.

Troubleshooting

  • Common issues:

    • Incorrect barcode string or filter settings may result in no splits or unexpected output.
    • Providing an invalid or inaccessible PDF URL will cause failures in fetching the document.
    • Insufficient API permissions or missing API key will lead to authentication errors.
    • Setting an inappropriate DPI value might affect processing speed or output quality.
  • Error messages and resolutions:

    • "Failed to fetch PDF from URL": Check the URL accessibility and correctness.
    • "Barcode not found": Verify the barcode string, type, and filter options match the actual barcodes in the PDF.
    • "Authentication failed": Ensure the API key credential is correctly set up in n8n.
    • "Invalid binary property name": Confirm the binary field name matches the input data structure.

Links and References

Discussion