Built-in OCR and Barcode Recognition

The engine-free overloads of ApplyLoadedOCRTextLayer and DecodeLoadedPageBarcodes rely upon HotPDF's bounded built-in recognisers

OCR scope

The built-in OCR backend recognises machine-printed ASCII letters and digits, including mixed-case text, using Otsu binarisation backed by a local-window fallback; glyphs are extracted as connected components and matched against cached multi-font glyph templates with bounded grayscale template matching

Regular, bold, italic and bold italic templates cover Arial, Times New Roman, Courier New, Tahoma and Segoe UI, so no external OCR installation is needed

The recogniser normalises light text on a predominantly dark background and will accept faded text provided the grayscale range spans at least 16 of the 255 levels, whilst the caller's bitmap and its word coordinates are left untouched

Upper- and lowercase shapes are separated by line-level height clustering and case-context preference, i and j dots merge with their stems, speckle noise beneath the minimum component area is disregarded, and word gaps are detected via bimodal gap clustering

Recognised words report per-line baselines and cap heights so that ApplyLoadedOCRTextLayer can position searchable text precisely

Natural scenes, unsupported fonts, very small text and ambiguous shapes still yield no guessed word, and any word holding an unrecognised retained glyph is omitted in its entirety rather than quietly losing characters

Uniform backgrounds and images whose grayscale range falls below 16 levels return no result; automatic polarity selection presumes the background covers most of the page

A valid image with no recognised words completes successfully with an empty result array, covering blank, low-contrast and unsupported-text pages; scanned-document batches carry on to later pages, whilst invalid requests, cancellation and exhausted limits still fail

Windows FPC reads both 24-bit and 32-bit input bitmaps without changing their pixel format or discarding the original pixels

Barcode scope

The built-in linear backend decodes Code 39, Code 128 sets A/B/C with SHIFT and FNC controls, EAN-8, EAN-13, UPC-A and UPC-E with their required checksums

QR Code versions 1 to 40 support quarter-turn and mirror orientations, finder-based perspective sampling, BCH format recovery and Reed-Solomon correction of damaged codewords within each block's capacity

Data Matrix ECC 200 supports square sizes from 10 to 144 modules, the six standard rectangular sizes, multiple regions and blocks, and ASCII, C40, Text, X12, EDIFACT and Base256 payloads

PDF417 supports text, numeric and byte compaction with GF(929) Reed-Solomon correction at error correction levels 0 through 8

Byte payloads preserve their raw bytes and honour supported ECI character sets, including UTF-8; unsupported ECI values fail explicitly

Each built-in image scan locates multiple separated supported symbols, keeps repeated payloads at different positions and reports per-symbol bounds and confidence; Multi-symbol Raster Barcode Scanning provides the native helper, projected Data Matrix corners and scanning budgets

Data Matrix supports rotated and trapezoidal projective sampling, including correctable data-module damage; DMRE remains outside the decoder, and PDF417 recovery requires every row's locator patterns to remain recognisable

Damage that destroys locator geometry or exceeds correction capacity returns no result, and touching or overlapping symbols can prevent independent localisation

Budgets and atomicity

Recognition is limited to 4096 by 4096 images and 4,194,304 pixels, with fixed time, result, text and raw-byte limits

Built-in OCR checks its two-second deadline and cancellation token during pixel conversion, thresholding, component extraction, glyph normalisation and line analysis; an 8,192-component ceiling bounds dense-noise analysis

Cancellation propagates through the existing OCR and barcode pipelines, which publish results only once the complete request has succeeded