OCR Activities
Version: 1.2.5 · ID: zoan-packages-ocr · Author: Zoan Software
The OCR package (Optical Character Recognition) reads the text that appears inside an image: a scanned document, a photo of a document, a screenshot. It complements the PDF package: when a document is an image (it has no selectable text), the PDF activities cannot read it — but OCR can.
It uses the Tesseract 5 engine in LSTM mode, a widely used open-source text recognizer, with OpenCV-based image preprocessing. Spanish and English come bundled with the package: there is nothing else to install. Recognition runs on the robot’s machine (images are not sent anywhere) and the package works on Windows robots.
Input formats
Section titled “Input formats”The activities that read files accept .png, .jpg, .bmp and .tiff images. For a scanned PDF, first convert its pages to images with PDF to Images and pass each image to OCR.
Text language
Section titled “Text language”Almost every activity accepts a language parameter with the code of the language to recognize:
| Value | Language |
|---|---|
eng | English (default) |
spa | Spanish |
eng+spa | Several languages at once |
It also accepts regional tags such as es-CO or en-US, which are mapped to the Tesseract code (es → spa, en → eng; also pt, fr, de, it and ca). An unrecognized tag is treated as English. A code that is not installed raises the error Tesseract language '…' not found, with the list of available ones.
Setting the right language greatly improves accuracy (accents, ñ, etc.). For Spanish text, always use
language = "spa". To see which languages are available, use OCR Get Available Languages.
Image preprocessing
Section titled “Image preprocessing”The preprocess parameter cleans up the image before recognizing it, which improves results on poor-quality scans. It is available in OCR Recognize File and the three structured-extraction activities:
| Value | What it does |
|---|---|
none | No preprocessing (default, except in OCR Extract Table, which uses auto) |
auto | Full cleanup: grayscale, noise removal, binarization and deskew |
deskew | Only straightens a skewed image (rotates it if the skew exceeds about 0.3°) |
binarize | Converts to black and white with an adaptive threshold (improves contrast) |
The original image is not changed: the cleanup happens in memory.
Two sources: file or screen
Section titled “Two sources: file or screen”- From an image file (
.png,.jpg,.bmp,.tiff): OCR Recognize File and the structured-extraction activities. - From the screen: OCR Recognize Screen Region (an area), OCR Screenshot (the whole screen) and OCR Find Text (in a region). These require an interactive desktop session (like the Desktop package): they capture what is visible at that moment.
Coordinates
Section titled “Coordinates”The activities that return positions (OCR Find Text, OCR Get Lines) use pixels with the origin at the top-left corner of the analyzed image: the file’s, or on screen, the captured region’s. To get screen coordinates, add the region’s x/y.
Activities
Section titled “Activities”Recognize text
Section titled “Recognize text”| Activity | Type | Output | What it does |
|---|---|---|---|
| OCR Recognize File | ocr-recognize | string | Reads the text of an image file |
| OCR Recognize Screen Region | ocr-recognize-region | string | Reads the text of a screen area |
| OCR Screenshot | ocr-screenshot | string | Reads all the text of a screen |
Find and locate
Section titled “Find and locate”| Activity | Type | Output | What it does |
|---|---|---|---|
| OCR Find Text | ocr-find-text | object | Finds the position of a text |
| OCR Get Lines | ocr-get-lines | List<object> | Structured list of lines and words with coordinates |
Structured extraction
Section titled “Structured extraction”| Activity | Type | Output | What it does |
|---|---|---|---|
| OCR Extract Pattern | ocr-extract-pattern | Dictionary<string, string> | Extracts fields with regular expressions |
| OCR Extract Form Fields | ocr-extract-form | Dictionary<string, string> | Extracts text from named regions |
| OCR Extract Table | ocr-extract-table | DataTable | Extracts a table from an image into a DataTable |
Utility
Section titled “Utility”| Activity | Type | Output | What it does |
|---|---|---|---|
| OCR Get Available Languages | ocr-get-languages | List<string> | Available languages |
A typical flow
Section titled “A typical flow”Read a scanned invoice and extract its number:
OCR Recognize File path = imagePath language = "spa" preprocess = "auto" → output: textSet Variable name = number value = regexFind(text, "INV-\d+")Next steps
Section titled “Next steps”- OCR Recognize File — read text from an image.
- OCR Extract Pattern — extract specific fields from a document.
- PDF — for PDFs with selectable text (no OCR).