function VisitStructureElements(PageNumber: Integer; const Options: TPdfStructureReadOptions; Visitor: TPdfStructureElementVisitor; out Status: TPdfStructureReadStatus): Integer;
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 in the same way ReadStructureElements does
Count := Pdf1.VisitStructureElements(1, Options, procedure(const E: TPdfStructureElement)
begin
Log(E.TypeName);
end, Status);