Skip to content

OCR Activities

Version: 1.0.0  ·  ID: zoan-packages-ocr  ·  Author: Zoan Software

The OCR (Optical Character Recognition*) package reads text that appears within an image: a scanned PDF, a photo of a document, a screenshot. It’s the add-on to the PDF package: When a document is an image (no selectable text), PDF activities can’t read it — but OCR can.

It uses the Tesseract engine, a widely used open source text recognizer.

Almost all activities accept a parameter language with the language code of the text to be recognized:

ValueIdioma
engEnglish (default)
spaSpanish
eng+spaSeveral languages at the same time

Indicating the correct language greatly improves precision for accents and locale-specific characters. For Spanish text, always use language = "spa". To see which languages are available, use OCR Get Available Languages.

The preprocess parameter applies a cleanup to the image before recognizing it, which improves the result on poor quality scans:

ValueWhat are you doing
noneNo preprocessing (default in most)
autoLimpieza completa: quita ruido, binariza y endereza
deskewJust straighten a crooked image
binarizeConvert to black and white (improves contrast)
ActivityTypeOutputWhat it does
OCR Recognize Fileocr-recognizestringRead text from an image file
OCR Recognize Screen Regionocr-recognize-regionstringRead text from an area of the screen
OCR Screenshotocr-screenshotstringRead all text on the screen
ActivityTypeOutputWhat it does
OCR Find Textocr-find-textobjectFind the position of a text
OCR Get Linesocr-get-linesListStructured list of lines and coordinates
ActivityTypeOutputWhat it does
OCR Extract Patternocr-extract-patternDictionaryExtract fields with regular expressions
OCR Extract Form Fieldsocr-extract-formDictionaryExtrae texto de regiones nombradas
OCR Extract Tableocr-extract-tableDataTableDetect a table in the image
ActivityTypeOutputWhat it does
OCR Get Available Languagesocr-get-languagesListIdiomas disponibles

Read a scanned invoice and extract its number:

OCR Recognize File path = = rutaImagen language = "spa" preprocess = "auto" → output: texto
Set Variable name = numero value = = regexFind(texto, "FAC-\d+")