property StructureCacheCapacity: Integer; // read and write, default 8
Reading StructureElementsForPage parses the tagged structure tree of a page into a managed snapshot. The cache keeps one slot per document page and retains completed trees in least-recently-used order up to this capacity, so that repeated accessibility checks and structure traversals skip the native walk
Each retained tree is measured with an estimate covering its element records, strings, identifier arrays and attribute values, and reserves that estimate in the shared CacheBudgetBytes governor
Reducing the capacity evicts the least recently used trees and releases their governor bytes immediately
Setting the capacity to zero clears the cache and disables retention, whilst direct reads through StructureElementsForPage and ReadStructureElements keep working and simply re-parse every time
Negative values raise EPdfError
An incomplete traversal, one whose Status.Completed is False because a depth, element, attribute or deadline limit was hit, is returned to the caller but never cached
Pdf.StructureCacheCapacity := 16;
Elements := Pdf.StructureElementsForPage[PageNumber];