EnumPathElements

Extraction, Page Manipulation

Description

Enumerates every vector path object on a page across all content layers. Each path construction and painting sequence is lifted into one TPDFlibPageElement record with Kind ekPath, a bounding box that includes curve control points, the segment count, the closed flag, and the painting operator name. Each element also receives an ElementID snapshot for later detail queries

Syntax

Delphi

Procedure TPDFlib.EnumPathElements(Page: Integer;
  Var Elements: Array Of TPDFlibPageElement;
  Var ElemIndex, TotalCount: Integer);

Parameters

Page1-based page number to enumerate
ElementsCaller-allocated array of TPDFlibPageElement that receives the records; only as many records as the array capacity are stored
ElemIndexIn-out index; pass 0 on entry, on exit it holds the number of records stored in Elements
TotalCountIn-out counter; on exit it holds the total number of paths found, even when it exceeds the capacity of Elements

Remarks

Coordinates are returned in the top-left origin coordinate system used by the page element helpers. Compare ElemIndex with TotalCount to detect truncation, or call twice and size the array from the first pass

For a higher-level enumeration that also covers text, images, and shading placements see EnumPageElements

Example

Total:= 0;
SetLength(Elements, 0);
PDF.EnumPathElements(1, Elements, Count, Total);
SetLength(Elements, Total);
Count:= 0; Total:= 0;
PDF.EnumPathElements(1, Elements, Count, Total);