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
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_BYTES50 MiBLargest input file -
OCR_TESSERACT_MAX_OUTPUT_BYTES50 MiBLargest saved result -
OCR_TESSERACT_TIMEOUT_MS120000Per tesseract/pdftoppm run (1000 to 280000), the process is killed when it passes -
OCR_TESSERACT_MAX_INPUT_PIXELS40000000Most pixels (width × height) of an image, or of a PDF page rendered at dpi -
TESSERACT_BINARYOn PATHAbsolute paths to the programs -
PDFTOPPM_BINARY
How to use it
In Graphrt Desktop
- Open Plugins and search for OCR (Tesseract).
- Click Install and approve it.
- Follow the setup steps on the plugin's page, then paste the settings it needs.
- Describe a job that needs it, and the builder adds the steps.
With the CLI
terminal
$ graphrt plugin install ocr-tesseract workflow.yaml
- id: ocr_tesseract type: ocr-tesseract.list_languages