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

NameTypeAccessDescription
RoleMap: Map<string, string>ReadCustom role -> mapped role name, from /RoleMap (values are name strings).
ClassMap: Map<string, PdfObject>ReadClass name -> attribute object, from /ClassMap (raw, unresolved values).
ChildrenStructElement[]ReadGets the children.

Methods

SignatureDescription
constructor(doc: Document, Dict: PdfDict, Ref: PdfRef | undefined)Calls constructor(doc, Dict, Ref) on this StructTreeRoot instance.
ResolveRole(role: string)stringFollow the RoleMap chain from role to a standard structure type.
ElementFor(structParentsKey: number, mcid: number)StructElement | undefinedThe element for a page’s marked content: ParentTree[structParentsKey] is an array indexed by MCID.
ElementForObject(structParentKey: number)StructElement | undefinedThe element for an object (annotation / XObject) via its /StructParent key: ParentTree[structParentKey] is the element directly.
GetText()stringThe whole tree’s text, in reading order.
Append(type: string, opts: ElemOpts)StructElementCreate 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).