OCRDocument

OCR, rendering, document editing

Description

Runs the OnOCRPage provider pipeline over a page range while retaining only one raster page at a time

Syntax

Delphi

Function TPDFlib.OCRDocument(Const PageRange: WideString; DPI: Double;
  Const Language, FontName: WideString; MinConfidence: Double): Integer;

Parameters

PageRangeA page-range expression such as 1-3,7, or an empty string for every page
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

The number of pages processed before completion, failure, or cancellation

A successful call returns the number of pages selected by PageRange

Remarks

Each PNG is released after its callback and before the next page is rendered, so peak raster memory follows the largest page rather than the page count

Operation progress and cooperative cancellation use the normal PDF Library for Delphi progress lifecycle

See also

OCRPage, OnOCRPage, ApplyOCRTextLayer, LastOCRError