PDFium Delphi Component Docs

VisitStructureElements method

Component: TPdf  ·  Unit: PDFium
Streams the structure tree of one page through a visitor callback

Syntax

function VisitStructureElements(PageNumber: Integer; const Options: TPdfStructureReadOptions; Visitor: TPdfStructureElementVisitor; out Status: TPdfStructureReadStatus): Integer;

Description

VisitStructureElements walks the structure tree of PageNumber (one-based) and calls Visitor for every element instead of building the full TPdfStructureElements array

The return value is the number of visited elements; Status reports bounded or failed reads the same way ReadStructureElements does

Remarks

Example

procedure TMain.OnStructureElement(Sender: TObject; const Element: TPdfStructureElement; ElementIndex: Integer; var KeepGoing: Boolean);
begin
  Log(Element.TypeName);
end;

Count := Pdf1.VisitStructureElements(1, TPdfStructureReadOptions.Default, OnStructureElement, Status);

See Also

ReadStructureElements, StructureElements, Structure traversal