Graphrt

OCR (Tesseract)

Text, hOCR or TSV from images or PDF pages (via poppler's pdftoppm) in allowed directories, installed-language and page-segmentation choices, inputs checked by content, argument arrays, timeouts

Stable v0.1.0 Node.js 2 actions
Use in Graphrt Desktop

About

A Graphrt plugin for OCR with the system Tesseract. Workflows and agents can read text from scanned images, photos of documents and PDF pages that live in directories you allow, as plain text, hOCR or TSV.

What it can do

  • list_languages: the installed language packs (e.g. eng, ind, chi_sim) and the tessdata directory.
  • ocr: an image (png, jpeg, tiff, bmp, gif, webp) or one page of a PDF (rendered at dpi with poppler's pdftoppm), with languages (1–5 installed codes), psm (page segmentation mode 0–13) and output_format: text, hocr (HTML with word boxes) or tsv (one row per word with box and confidence). max_chars caps the returned text (truncated says so), save_output: true also writes it to a new file in OCR_TESSERACT_OUTPUT_DIR.

Actions

Each action is a step you can add to a workflow. Agents can also use most of them as tools.

  • List OCR languages ocr-tesseract.list_languages
  • Recognise text ocr-tesseract.ocr

Settings

Graphrt starts plugins with a clean environment. Only these values reach the plugin, and secrets stay out of logs.

  • OCR_TESSERACT_INPUT_DIRS (required)
    Comma-separated directories (absolute or ~/...) that images and PDFs may be read from, subdirectories included
  • OCR_TESSERACT_OUTPUT_DIR (none)
    Existing directory for save_output, reading text needs no output directory
  • OCR_TESSERACT_MAX_INPUT_BYTES 50 MiB
    Largest input file
  • OCR_TESSERACT_MAX_OUTPUT_BYTES 50 MiB
    Largest saved result
  • OCR_TESSERACT_TIMEOUT_MS 120000
    Per tesseract/pdftoppm run (1000 to 280000), the process is killed when it passes
  • OCR_TESSERACT_MAX_INPUT_PIXELS 40000000
    Most pixels (width × height) of an image, or of a PDF page rendered at dpi
  • TESSERACT_BINARY On PATH
    Absolute paths to the programs
  • PDFTOPPM_BINARY

How to use it

In Graphrt Desktop

  1. Open Plugins and search for OCR (Tesseract).
  2. Click Install and approve it.
  3. Follow the setup steps on the plugin's page, then paste the settings it needs.
  4. Describe a job that needs it, and the builder adds the steps.
Plugins in Graphrt Desktop

With the CLI

terminal
$ graphrt plugin install ocr-tesseract
workflow.yaml
- id: ocr_tesseract
  type: ocr-tesseract.list_languages
Plugins in the docs