StructTreeRoot
Overview
StructTreeRoot is a class in Aspose.PDF FOSS for TypeScript.
The document’s logical structure tree: a live handle over /StructTreeRoot.
This class declares 7 methods for StructTreeRoot objects in TypeScript programs.
Available methods include: Append, ElementFor, ElementForObject, GetText, RegisterRole, ResolveRole, constructor.
All public members are accessible to any TypeScript application after installing the Aspose.PDF FOSS for TypeScript package.
Properties: Children, ClassMap, RoleMap.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
RoleMap | : Map<string, string> | Read | Custom role -> mapped role name, from /RoleMap (values are name strings). |
ClassMap | : Map<string, PdfObject> | Read | Class name -> attribute object, from /ClassMap (raw, unresolved values). |
Children | StructElement[] | Read | Gets the children. |
Methods
| Signature | Description |
|---|---|
constructor(doc: Document, Dict: PdfDict, Ref: PdfRef | undefined) | Calls constructor(doc, Dict, Ref) on this StructTreeRoot instance. |
ResolveRole(role: string) → string | Follow the RoleMap chain from role to a standard structure type. |
ElementFor(structParentsKey: number, mcid: number) → StructElement | undefined | The element for a page’s marked content: ParentTree[structParentsKey] is an array indexed by MCID. |
ElementForObject(structParentKey: number) → StructElement | undefined | The element for an object (annotation / XObject) via its /StructParent key: ParentTree[structParentKey] is the element directly. |
GetText() → string | The whole tree’s text, in reading order. |
Append(type: string, opts: ElemOpts) → StructElement | Create a top-level structure element of type and return its handle. |
RegisterRole(custom: string, standard: string) | Map a custom structure type custom to a standard type standard in the /RoleMap (writes the dict and updates the in-memory map). |