The root of a document's structure tree: its top-level elements, role and class maps, namespaces, and the lookups from content to elements.
public sealed class PdfStructureTreeRoot
ISO 32000-2 §14.7.2, Table 354. A live view over the structure tree root dictionary: Children and the map properties read it on every call. The lookups (FindElement(PdfPage, Int32), FindElementById(ReadOnlySpan<Byte>), Elements) use indexes built on first use and kept while every object they were built from keeps its version: an edit, through this API or directly on the COS objects, is seen by the next lookup. They are safe to use from several threads while nobody changes the document.
Reading never changes the file's objects; every repair (a wrong P, a missing Pg, a cycle) is made in the view and
recorded as a diagnostic when the part concerned is first read.
Writing (issue #156): CreateStructureTree() starts a tree; AddElement(PdfStructureType),
AddElement(PdfStructureType), AddMarkedContent(PdfPage) and
AddObjectReference(CosReference, PdfPage?) grow it, keeping the parent tree and ParentTreeNextKey in step; role
maps, namespaces, class maps, attributes, IDs and the text entries are edited in place. New objects are made with
AddObject(CosObject), so both full and incremental saves write them.
kind:method, kind:property, kind:ctor. Press Esc to clear.AssociatedFilesGets the files associated with the whole tree (AF), in order.ChildrenGets the top-level structure elements (K), in logical order.ClassMapGets the class map (ClassMap): attribute class names mapped to attribute objects, or null.DictionaryGets the structure tree root dictionary.ElementsGets every element reachable from the root, in document order: depth first, each element before its children, children in K order; an element reachable twice is listed once.IdTreeGets the ID tree (IDTree): element identifiers to elements; null when there is none.MinimumVersionGets the lowest PDF version that has everything the tree uses.NamespacesGets the namespaces the document declares (Namespaces), in order.ParentTreeGets the parent tree (ParentTree): content streams' StructParents and objects' StructParent keys to their elements; null when there is none.ParentTreeNextKeyGets ParentTreeNextKey, the key the next parent-tree entry will use, or null.PronunciationLexiconGets the pronunciation lexicons (PronunciationLexicon) as their COS array of file specifications, or null.ReferenceGets the indirect reference to the root, when the catalog holds one.RoleMapGets the role map (RoleMap): structure types of the default namespace mapped to other types, or null.AddClassAttributes(CosName, CosName)Adds an attribute object of owner to the attribute class className in the root's ClassMap.AddElement(PdfStructureType)Adds a structure element of type as the last top-level element.AddElement(String)Adds a structure element of type, in the default namespace, as the last top-level element.FindElement(CosStream, Int32)Finds the structure element that owns the marked-content sequence mcid in contentStream, a form XObject or another stream with its own StructParents.FindElement(PdfPage, Int32)Finds the structure element that owns the marked-content sequence mcid in the content of page.FindElementById(ReadOnlySpan<Byte>)Finds the element whose ID is id.FindElementForObject(CosObject)Finds the structure element that has contentItem, an annotation or XObject with a StructParent entry, as an object content item.GetMarkedContentElements(CosStream)Returns the MCID-to-element map of contentStream.GetMarkedContentElements(PdfPage)Returns the MCID-to-element map of the content of page.GetOrAddNamespace(String)Returns the namespace named name that Namespaces lists, adding a namespace dictionary for it when there is none.MapRole(CosName, CosName)Maps type, a structure type of the default namespace, to target in the root's RoleMap.RemoveRoleMapping(CosName)Removes the role mapping of type from the root's RoleMap.