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

PageThe one-based page number
DPIThe positive raster resolution sent to the provider
LanguageA provider-defined language hint
FontNameAn embeddable TrueType font name or path, or an empty string for fallback selection
MinConfidenceThe inclusive threshold from 0 through 1

Return values

1The provider result was applied
0The operation failed or was cancelled

Remarks

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

See also

OCRDocument, OnOCRPage, ApplyOCRTextLayer, LastOCRError