PdfStructureTreeRoot Class

Definition

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

Remarks

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.

Tip: use kind:method, kind:property, kind:ctor. Press Esc to clear.

Properties (13)

Methods (12)