ConfigureNativeOCR
OCR
Description
Enables the built-in template-matching OCR engine for OCRPage and OCRDocument, so scanned pages become searchable without any external tool
Syntax
Delphi
Function ConfigureNativeOCR: Boolean;ActiveX
Function PDFlib::ConfigureNativeOCR() As LongDLL
int DLConfigureNativeOCR(int InstanceID);Return values
| True when the engine is ready; the template set is built once per process and later calls reuse it |
Remarks
The engine binarises the page raster with an Otsu threshold, estimates and corrects small page skew by maximising horizontal projection variance, segments the image into lines and glyphs, and recognises each glyph by template matching against sans-serif (Helvetica-Bold), serif (Times-Bold), and monospace (Courier-Bold) glyph sets bootstrapped from the library rendering pipeline, picking the highest-scoring font family per line; it targets clean machine-printed text, and the external Tesseract provider through ConfigureTesseractOCR remains available for difficult scans