Release pdfOCR 5.0.1
The previous release of the pdfOCR add-on for iText Core brought big changes, with support for PaddleOCR and EasyOCR models, GPU acceleration, and general OCR improvements. As you might expect then, version 5.0.1 is a little more subdued, focusing on improvements and bug fixes.
This release of the pdfOCR add-on for iText Core adds stream-based input support, fixes the default vocabulary for parSeq models, and resolves a crash in text line sorting. There are no breaking changes.
Stream-Based Input for OCR
The IOcrEngine.doImageOcr method now accepts streams in addition to file instances, allowing you to pass in-memory images directly without writing them to disk. Additionally, OcrPdfCreator.makePdfSearchable has been updated to avoid creating temporary files under the hood, improving performance and simplifying usage in environments where file system access is restricted.
Default Vocabulary Fix for parSeq Models
The default vocabulary for parSeq recognition models has been changed from LATIN_EXTENDED to FRENCH, which provides better out-of-the-box support for accented characters commonly found in European languages. Multilingual model usages now explicitly specify LATIN_EXTENDED to preserve their broader character set behavior.
Text Line Sorting Crash Fix
A crash in sortTextInfosByLines caused by a comparator contract violation has been fixed. The issue occurred when rotated text boxes had angle differences that were individually below the threshold but accumulated transitively, breaking Java's comparator requirements. This could manifest as an IllegalArgumentException: Comparison method violates its general contract error.
Improvements
- DEVSIX-4993 – Support stream input for IOcrEngine.doImageOcr and avoid temp files in makePdfSearchable
- DEVSIX-9989 – Use French vocabulary by default for parSeq models
Bug fixes
- DEVSIX-9901 – Fix sortTextInfosByLines crash due to comparator contract violation