npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

n8n-nodes-doctr

v0.1.7

Published

Extract text from images using docTR OCR in n8n workflows

Readme

n8n-nodes-doctr

This is an n8n community node that integrates docTR (Document Text Recognition) for extracting text from images in your n8n workflows.

docTR is a state-of-the-art OCR (Optical Character Recognition) library that uses deep learning models to extract text from document images with high accuracy.

n8n is a fair-code licensed workflow automation platform.

Installation Operations Compatibility Usage Resources

Installation

Install the n8n Node

Follow the installation guide in the n8n community nodes documentation.

Quick install:

npm install n8n-nodes-doctr

Python Prerequisites

This node requires Python 3.8+ and the docTR library to be installed on the same machine where n8n is running.

  1. Install Python 3.8 or higher

    • Ensure python3 is available in your system PATH
  2. Install docTR and dependencies

    pip install -r requirements.txt

    Or install manually:

    # For PyTorch backend (recommended)
    pip install python-doctr[torch]
    
    # Or for TensorFlow backend
    pip install python-doctr[tf]
  3. Verify installation

    python3 -c "from doctr.models import ocr_predictor; print('docTR installed successfully')"

Operations

The Doctr OCR node provides a single operation:

Extract Text from Image

Processes binary image data through docTR's OCR engine and returns extracted text.

Parameters:

  • Binary Property: Name of the binary property containing the image (default: data)
  • Output Format: Choose what data to return:
    • Plain Text Only: Returns just the extracted text as a string
    • Structured Data Only: Returns the full OCR result with word/line/block positions
    • Both: Returns both plain text and structured data

Supported Image Formats:

  • PNG
  • JPG/JPEG
  • TIFF
  • BMP
  • And other common image formats supported by PIL/Pillow

Compatibility

  • Minimum n8n version: 0.198.0
  • Tested with: n8n 1.0+
  • Python: 3.8, 3.9, 3.10, 3.11
  • docTR: 0.5.0+

Usage

Basic Text Extraction

  1. Add a node that provides binary image data (e.g., HTTP Request, Read Binary File)
  2. Add the Doctr OCR node
  3. Configure the binary property name (usually data)
  4. Select output format (e.g., "Plain Text Only")
  5. The extracted text will be available in the output

Example Workflow

[Read Binary Files] → [Doctr OCR] → [Process Text]

Use Cases:

  • Extract text from scanned documents
  • Process receipts and invoices
  • Digitize handwritten notes
  • Extract data from screenshots
  • Process forms and questionnaires

Working with Structured Data

When you select "Structured Data Only" or "Both" as output format, you'll receive detailed position information:

{
  "structuredData": {
    "pages": [
      {
        "blocks": [
          {
            "lines": [
              {
                "words": [
                  {
                    "value": "text",
                    "confidence": 0.99,
                    "geometry": [[x1, y1], [x2, y2]]
                  }
                ]
              }
            ]
          }
        ]
      }
    ]
  }
}

This structured data is useful for:

  • Extracting specific regions of text
  • Preserving document layout
  • Filtering by confidence scores
  • Building custom text processing logic

Troubleshooting

Error: "Failed to start OCR process"

  • Ensure Python 3 is installed and accessible via python3 command
  • Verify docTR is installed: pip list | grep doctr

Error: "OCR processing error"

  • Check that the input is valid binary image data
  • Verify the image format is supported
  • Ensure sufficient memory is available for the OCR model

Slow Performance

  • First execution loads the model (can take 5-10 seconds)
  • Subsequent executions are faster
  • Large images take longer to process
  • Consider resizing very large images before OCR

Resources

Version History

0.1.0

  • Initial release
  • Support for plain text and structured data extraction
  • PyTorch and TensorFlow backend compatibility