PDFium Delphi Component Docs

ReadPageObjectsSnapshot method

Component: TPdf  ·  Unit: PDFium
Reads an owned, handle-free snapshot of every page object on one page

Syntax

function ReadPageObjectsSnapshot(PageNumber: Integer; const Options: TPdfPageObjectSnapshotOptions; out Status: TPdfPageObjectSnapshotStatus): TPdfPageObjectsSnapshot;

Description

ReadPageObjectsSnapshot copies type, bounds, transforms, text, mark, and dependency facts of all page objects of one page into an owned TPdfPageObjectsSnapshot that contains no native FPDF_PAGEOBJECT handles

PageNumber is one-based; Status reports why an empty snapshot came back so callers can distinguish a missing page from a bounded read

Remarks

    • Because the snapshot owns its strings and arrays, it stays valid after the document is closed or reloaded
    • Repeated reads are served from the page-object snapshot cache; see PageObjectSnapshotCacheCapacity
    • Use PageObjectsSnapshot to read the cached snapshot of the current page

Example

Inspect all objects of a page outside any rendering callback

var Snap: TPdfPageObjectsSnapshot; Status: TPdfPageObjectSnapshotStatus;
Doc := Pdf1.ReadPageObjectsSnapshot(1, Default(TPdfPageObjectSnapshotOptions), Status);

See Also