OnOCRPage

OCR, events

Description

Supplies one PNG page to an application-selected OCR provider and receives versioned OCR JSON

Syntax

Delphi

Property TPDFlib.OnOCRPage: TPDFlibOCRProviderEvent
  Read FOnOCRPage
  Write FOnOCRPage;

Remarks

The callback object belongs to the application unless it was created by ConfigureTesseractOCR

ClearTesseractOCR and instance destruction release only the configured owned provider; a later application callback is retained and its object is not freed

The Ex page and document methods check the existing-text policy before rendering or invoking this event, counting foreign invisible text while ignoring exact owned old OCR layers

Set ResultJSON to the schema accepted by ApplyOCRTextLayer

Set Cancel to true to stop the page or document operation without applying the current result

The callback executes synchronously, so the image bytes remain valid until it returns

See also

TPDFlibOCRProviderEvent, OCRPage, OCRDocument