OCRPage
OCR, rendering, document editing
Description
Renders one page to PNG, invokes OnOCRPage, and applies the returned searchable text layer
Syntax
Delphi
Function TPDFlib.OCRPage(Page: Integer; DPI: Double; Const Language,
FontName: WideString; MinConfidence: Double): Integer;Parameters
| Page | The one-based page number |
|---|---|
| DPI | The positive raster resolution sent to the provider |
| Language | A provider-defined language hint |
| FontName | An embeddable TrueType font name or path, or an empty string for fallback selection |
| MinConfidence | The inclusive threshold from 0 through 1 |
Return values
| 1 | The provider result was applied |
|---|---|
| 0 | The operation failed or was cancelled |
Remarks
This method calls OCRPageEx with options zero and appends an owned layer once recognition succeeds
ConfigureTesseractOCR supplies an optional instance-owned engine adapter; application callbacks remain supported
Orientation detection is off by default and can be enabled explicitly during engine configuration, with low confidence reported as a failure
Use OCRPageEx for the existing-text and owned-layer replacement policies
The provider receives PNG bytes only for the requested page
LastErrorCode is 514 when no provider is assigned or the callback or page rendering fails