PDFium Delphi Component Docs

ReadTextPageSnapshot method

Component: TPdf  ·  Unit: PDFium
Reads an owned snapshot of one text page without native handles

Syntax

function ReadTextPageSnapshot(PageNumber: Integer; const Options: TPdfTextSnapshotOptions; out Status: TPdfTextSnapshotStatus): TPdfTextPageSnapshot;

Description

ReadTextPageSnapshot copies the character, rectangle, and index facts of the text page of PageNumber (one-based) into an owned TPdfTextPageSnapshot

Status distinguishes a missing page, an unparseable text layer, and bounded reads; the snapshot itself keeps no FPDF_TEXTPAGE handle and survives document reloads

Remarks

    • Reading a page that does not exist yields an empty snapshot with a matching status instead of raising
    • Repeated reads are served from the text snapshot cache; see TextSnapshotCacheCapacity and TextPageSnapshot

Example

var St: TPdfTextSnapshotStatus;
Snap := Pdf1.ReadTextPageSnapshot(1, Default(TPdfTextSnapshotOptions), St);

See Also