StructTreeRoot

StructTreeRoot

概述

StructTreeRoot 是 Aspose.PDF FOSS 为 TypeScript 提供的类。

文档的逻辑结构树:对 /StructTreeRoot 的实时句柄。

此类为 TypeScript 程序中的 StructTreeRoot 对象声明了 7 个方法。可用的方法包括:Append、ElementFor、ElementForObject、GetText、RegisterRole、ResolveRole、constructor。在安装 Aspose.PDF FOSS 为 TypeScript 提供的包后,所有公共成员对任何 TypeScript 应用程序均可访问。属性:Children、ClassMap、RoleMap。

属性

名称类型访问描述
RoleMap: Map<string, string>读取自定义角色 -> 映射的角色名称,来源于 /RoleMap(值为名称字符串)。
ClassMap: Map<string, PdfObject>读取类名 -> 属性对象,来源于 /ClassMap(原始、未解析的值)。
ChildrenStructElement[]读取获取子项。

方法

签名描述
`constructor(doc: Document, Dict: PdfDict, Ref: PdfRefundefined)`
ResolveRole(role: string) → string沿着从 role 开始的 RoleMap 链,直至标准结构类型。
ElementFor(structParentsKey: number, mcid: number) → `StructElementundefined`
ElementForObject(structParentKey: number) → `StructElementundefined`
GetText() → string整棵树的文本,按阅读顺序。
Append(type: string, opts: ElemOpts) → StructElement创建一个 type 的顶层结构元素并返回其句柄。
RegisterRole(custom: string, standard: string)在 the /RoleMap 中将自定义结构类型 custom 映射到标准类型 standard(写入字典并更新内存映射)。
 中文