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 operation, Image Extract Text, extracts text content from an image file. It supports multiple input methods for providing the image: 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 entry by extracting text from scanned documents or photos.
  • Processing receipts, invoices, or forms to capture textual information.
  • Extracting text from images for indexing or searching purposes.
  • Integrating OCR (Optical Character Recognition) capabilities into automation workflows.

Practical example:

  • A user uploads an image of a receipt in a previous node; this node extracts the text from that image and outputs it as structured JSON for further processing like expense tracking.

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 containing the image file (used if Input Data Type is Binary Data).
Base64 Image Content Base64 encoded image content (used if Input Data Type is Base64 String).
Image URL URL to the image file to extract text from (used if Input Data Type is URL).
Output File Name Name for the output extracted text file in JSON format (e.g., "image_text_extract.json").
Async Enable asynchronous processing (true/false).
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 extracted text from the provided image. This JSON structure typically includes recognized text segments and possibly metadata about the extraction process.

If configured, the node can also output the extracted text as binary data under a custom binary property name, allowing downstream nodes to handle the data as a file.

Dependencies

  • Requires access to an OCR service or library capable of extracting text from images. This is handled internally by the node's implementation.
  • No explicit external API keys or credentials are mentioned in the source code snippet, but the node may require proper configuration of such services depending on the environment.
  • Network access is needed if using the URL input method to fetch the image.

Troubleshooting

  • Common issues:

    • Providing an incorrect binary property name when using binary data input will cause the node to fail to find the image.
    • Invalid or inaccessible URLs will result in errors fetching the image.
    • Malformed base64 strings will cause decoding failures.
    • Large images or complex documents might lead to longer processing times or timeouts.
  • Error messages and resolutions:

    • "Binary property not found" — Verify the binary property name matches the actual property in the input data.
    • "Failed to fetch image from URL" — Check the URL accessibility and correctness.
    • "Invalid base64 content" — Ensure the base64 string is properly encoded without extra characters.
    • Timeout or slow response — Consider enabling asynchronous processing or reducing image size.

Links and References

Discussion