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

This node provides functionality to extract text from images. It supports multiple input methods for the image file, including binary data from a previous node, a base64 encoded string, or a direct URL to the image. The extracted text is output as JSON, which can be saved or further processed in workflows.

Common scenarios where this node is beneficial include:

  • Automating data extraction from scanned documents or photos.
  • Processing images containing text for indexing or searching.
  • Integrating OCR (Optical Character Recognition) capabilities into document workflows.

Practical example:

  • Extracting text from an invoice image received via email to automatically populate accounting software fields.
  • Reading text from product labels captured by a camera in a warehouse management system.

Properties

Name Meaning
Input Data Type Choose how to provide the image file to extract text from:
- Binary Data
- Base64 String
- URL
Input Binary Field Name of the binary property that contains the image file (used when Input Data Type is Binary Data)
Base64 Image Content Base64 encoded image content (used when Input Data Type is Base64 String)
Image URL URL to the image file to extract text from (used when Input Data Type is URL)
Output File Name Name for the output extracted text file (JSON format)
Async Enable asynchronous processing (true/false)

Output

The node outputs JSON data containing the extracted text from the provided image. This JSON typically includes recognized text strings and possibly their positions or confidence scores depending on the underlying OCR implementation.

If configured, the node can also output a JSON file with the extracted text, named according to the "Output File Name" property.

No binary output is indicated for this operation.

Dependencies

  • Requires access to an OCR service capable of extracting text from images.
  • Needs proper API authentication credentials configured in n8n to connect to the OCR backend.
  • Internet access may be required if using image URLs or external OCR services.

Troubleshooting

  • Common issues:

    • Providing an invalid or inaccessible image URL will cause failures.
    • Incorrect binary field name when using binary data input will result in missing image data errors.
    • Malformed base64 strings will cause decoding errors.
    • Network or authentication issues with the OCR service can lead to request failures.
  • Error messages and resolutions:

    • "Image not found or inaccessible": Verify the URL or binary data input.
    • "Invalid base64 content": Ensure the base64 string is correctly formatted without extra characters.
    • "Authentication failed": Check API key or credential configuration.
    • "Timeout or network error": Confirm network connectivity and service availability.

Links and References

Discussion