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 read barcodes from PDF files. It supports multiple input methods for the PDF file, including binary data from a previous node, base64 encoded string, or a URL pointing to the PDF. Users can specify which barcode types to detect and optionally limit the pages to scan. The node processes the PDF asynchronously by default and outputs the detected barcode data in JSON format.

This node is beneficial in scenarios where automated extraction of barcode information from PDFs is required, such as processing invoices, shipping labels, product catalogs, or any documents containing barcodes. For example, it can be used to extract tracking numbers from shipment PDFs or decode QR codes embedded in digital forms.

Properties

Name Meaning
Input Data Type Choose how to provide the PDF file: "Binary Data" (from previous node), "Base64 String" (base64 encoded PDF content), or "URL" (link to the PDF file).
Input Binary Field Name of the binary property containing the PDF file when using "Binary Data" input type.
Base64 PDF Content Base64 encoded string representing the PDF content, used when "Base64 String" input type is selected.
PDF URL URL to the PDF file to read barcodes from, used when "URL" input type is selected.
Output File Name Filename for the output JSON file containing the barcode data. Default is "read_barcode_from_pdf.json".
Barcode Type Type of barcodes to detect. Options include all common 1D and 2D barcode formats such as Code 39, Code 128, EAN-13, QR Code, PDF417, Data Matrix, and many others. "All" detects all supported types.
Pages Optional specification of page indices or ranges to process, e.g., "0,1,2-" or "1,2,3-7". Defaults to all pages if not specified.
Async Enable asynchronous processing of the PDF for barcode detection. Defaults to true.
Binary Data Output Name Custom name for the binary data field in the node's output. Default is "data".

Output

The node outputs JSON data containing the detected barcode information extracted from the PDF. This JSON includes details about each barcode found, such as its type, value, and position within the document. Additionally, the output can include binary data named according to the "Binary Data Output Name" property, which holds the barcode data file in JSON format.

If the node outputs binary data, it represents the barcode detection results serialized as a JSON file, useful for downstream nodes that require file inputs.

Dependencies

  • Requires access to the PDF file either via binary data, base64 string, or URL.
  • Depends on an external barcode reading library or service integrated within the node's implementation (not explicitly detailed in the source).
  • No explicit mention of API keys or external credentials; however, if URLs point to protected resources, appropriate authentication must be handled externally.
  • No special environment variables are indicated.

Troubleshooting

  • Common Issues:

    • Providing an incorrect binary property name when using binary input will cause the node to fail to locate the PDF file.
    • Invalid base64 strings or inaccessible URLs will result in errors during PDF loading.
    • Specifying invalid page ranges may lead to no barcodes being detected or errors.
    • Selecting unsupported barcode types or malformed input data could cause detection failures.
  • Error Messages:

    • Errors related to missing or unreadable PDF input typically indicate issues with the input data configuration.
    • Barcode detection errors might occur if the PDF does not contain any barcodes of the specified type.
    • Network errors when using URL input suggest connectivity or permission problems.
  • Resolutions:

    • Verify the binary property name matches the actual binary data field.
    • Ensure base64 content is correctly encoded and complete.
    • Confirm the URL is accessible and returns a valid PDF.
    • Use correct page range syntax and ensure pages exist in the PDF.
    • Test with "All" barcode types to confirm detection capability before narrowing down.

Links and References

Discussion