function ReadStructureElements(PageNumber: Integer; const Options: TPdfStructureReadOptions; out Status: TPdfStructureReadStatus): TPdfStructureElements;
Uses iterative pre-order traversal and returns a caller-owned flattened snapshot with stable Level and ParentIndex values
Each TPdfStructureElement also reports hierarchy facts through MarkedContentIDs, ChildCount, ChildMarkedContentIDs, and AttributeCount, table structure through HasHeaders, HeadersIds, and ColSpan, and the print and reference sentinels HasPrintField and HasReference
Role mapping is exposed through RoleMappedNamespaceUri and RoleMappedTypeName, associated files through HasAssociatedFile, AssociatedFileRelationship, AssociatedFileDescription, AssociatedFileDeclaredInCatalog, AssociatedFileDeclaredInStructure, AssociatedFileInEmbeddedFilesNameTree, AssociatedFileHasReadingOrder, and AssociatedFileReadingOrderIndex, and annotation facts through AnnotationSubtype, AnnotationContents, AnnotationAlternateText, IsArtifact, the widget sentinels WidgetCount and HasAppearance, and FieldAlternateName
MaxDepth, MaxElements, MaxAttributeValues, and DeadlineMilliseconds bound native work and managed allocation
IncludeAttributes=False keeps structure text, hierarchy, and MCIDs while skipping attribute value materialisation
Status.Completed is false when any budget is reached, the deadline expires, or a visitor stops traversal
Status.ElementsVisited and Status.AttributeValuesVisited count the work performed, while Status.DepthLimitReached, Status.ElementLimitReached, Status.AttributeLimitReached, and Status.DeadlineReached identify which budget stopped the walk
function VisitStructureElements(PageNumber: Integer; const Options: TPdfStructureReadOptions; Visitor: TPdfStructureElementVisitor; out Status: TPdfStructureReadStatus): Integer;
Calls Visitor once for each element without allocating the complete page array
Set the callback's KeepGoing parameter to false for a normal early stop reported by Status.VisitorStopped
Each callback receives managed element data that can be retained after the callback returns and no native structure handle is exposed
property StructureElementsForPage[PageNumber: Integer]: TPdfStructureElements; // read only
Reads any one-based page without changing PageNumber or firing OnPageChange
Complete default-budget results enter the shared LRU cache used by StructureElements, TPdfView.StructureElements, readable content, reflow, structured text, and accessibility validation
Nested dynamic arrays and attribute blobs are deep copied so changing a returned snapshot cannot modify the cache or the PDF
property StructureCacheCapacity: Integer; // read and write, default 8
Limits the number of complete page snapshots retained by least-recently-used order
Set the capacity to zero to release cached snapshots and disable future caching
Negative capacity values raise EPdfError
property StructureCacheCount: Integer; // read only
property StructureCacheHitCount: Int64; // read only
property StructureCacheMissCount: Int64; // read only
Expose cumulative lookup telemetry for the component instance
Edits invalidate the affected page or the complete cache while preserving cumulative counters
| MaxDepth | 256 |
| MaxElements | 100000 |
| MaxAttributeValues | 100000 |
| DeadlineMilliseconds | 0 for no deadline |
| IncludeAttributes | True |