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 functionality to split a PDF document based on the detection of barcodes within its pages. It scans the PDF for barcodes matching specified criteria and splits the document accordingly. This is particularly useful in scenarios where large PDFs contain multiple documents separated by barcode markers, such as batch scanned forms, invoices, or shipping labels.

Practical examples include:

  • Automatically splitting a batch of scanned invoices into individual files using invoice number barcodes.
  • Separating multi-page shipping manifests where each section starts with a barcode.
  • Processing forms where each form is identified by a unique barcode, enabling automated routing or storage.

Properties

Name Meaning
Input Data Type Method to provide the PDF data:
- Base64 String: Provide PDF content as a base64 encoded string.
- Binary Data: Use PDF file from previous nodes.
- URL: Provide URL to PDF file.
Binary Property Name Name of the binary property containing the PDF file (used when Input Data Type is Binary Data).
Base64 Content Base64 encoded PDF content (used when Input Data Type is Base64 String).
PDF URL URL to the PDF file (used when Input Data Type is URL).
Barcode String The barcode string to search for within the PDF pages.
Barcode Filter Filter type for barcode matching:
- Starts With
- Ends With
- Contains
- Exact Match
Barcode Type Type of barcode to detect:
- Any
- Data Matrix
- QR Code
- PDF417
Split Barcode Page Where to split relative to the barcode page:
- After: Split after the page containing the barcode.
- Before: Split before the page containing the barcode.
- Remove: Remove the barcode page from output.
Combine Pages With Same Consecutive Barcodes Whether to combine consecutive pages that have the same barcode value into a single split document.
PDF Render DPI Resolution in DPI used to render the PDF for processing barcodes:
- 100 DPI
- 150 DPI
- 200 DPI
- 250 DPI
Advanced Options Custom profiles in JSON format to adjust extra properties for API calls, allowing advanced customization of the splitting process.

Output

The node outputs an array of JSON objects representing the resulting split PDF documents. Each item typically contains the PDF data of one split segment, which can be in binary form or base64 encoded depending on configuration.

If the node supports binary output, the binary data represents the individual PDF files created after splitting by barcode.

Dependencies

  • Requires access to an external PDF processing service or API capable of reading barcodes and splitting PDFs accordingly.
  • Needs appropriate API authentication credentials configured in n8n to interact with the PDF processing backend.
  • Internet access may be required if providing PDF via URL or if the service is cloud-based.

Troubleshooting

  • Common Issues:

    • Incorrect barcode string or filter settings may result in no splits being detected.
    • Providing invalid or inaccessible PDF URLs will cause failures in fetching the document.
    • Insufficient DPI setting might lead to barcode detection failure; increasing DPI can improve accuracy but at the cost of performance.
    • If combining pages with the same barcode is enabled incorrectly, output documents may merge unexpectedly.
  • Error Messages:

    • Errors related to "PDF not found" or "Unable to fetch PDF" indicate issues with input data or URL accessibility.
    • "Barcode not detected" errors suggest that the barcode string or type does not match any barcode in the document.
    • Authentication errors imply missing or invalid API credentials.
  • Resolutions:

    • Verify the barcode string and filter options carefully.
    • Ensure the PDF URL is correct and accessible.
    • Adjust the PDF Render DPI to a higher value if barcodes are not detected.
    • Confirm API credentials are properly set up in n8n.

Links and References

  • PDF4me API Documentation — For details on custom profiles and advanced options.
  • Barcode Types Reference: Data Matrix, QR Code, PDF417 standards.
  • General n8n documentation on handling binary data and credentials.

Discussion