StructElement

StructElement

概述

StructElement 是 Aspose.PDF FOSS 中用于 TypeScript 的类。

结构树中的节点:对其真实 /StructElem 字典的实时句柄。

此类为 TypeScript 程序中的 StructElement 对象声明了 10 个方法。可用的方法包括:AddAnnotation、Append、GetBBox、GetText、MarkContent、NextMcid、SetLayoutAttributes、SetListAttributes、SetTableAttributes、constructor。在安装了用于 TypeScript 的 Aspose.PDF FOSS 包之后,所有公共成员对任何 TypeScript 应用程序均可访问。属性:A、ActualText、Alt、Attributes、C、Children,以及另外 17 项。

属性

名称类型访问描述
Typestring读取获取类型。
StandardTypestring读取获取标准类型。
IsStandardTypeboolean读取获取标准类型。
Parent`StructElementundefined`读取
ChildrenStructElement[]读取获取子元素。
Title`stringundefined`读写
Alt`stringundefined`读写
ActualText`stringundefined`读写
Expansion`stringundefined`读写
ID`stringundefined`读写
Lang`stringundefined`读写
EffectiveLang`stringundefined`读取
Page`Pageundefined`读取
Attributes{ A: PdfObject[]; C: PdfObject[] }读取获取属性。
A: PdfObject[]读取获取 a。
C: PdfObject[]读取获取 c。
ContentItemsContentItem[]读取获取内容项。
NodesStructNode[]读取获取节点。
g: GlyphEvent读取获取 g。
at: number读取获取 at。
TableAttributes`TableAttributesundefined`读取
ListAttributes`ListAttributesundefined`读取
LayoutAttributes`LayoutAttributesundefined`读取

方法

签名描述
`constructor(doc: Document, Dict: PdfDict, Ref: PdfRefundefined, Root: StructTreeRoot)`
GetText(skip: (e: StructElement) => boolean) → string此元素的文本及其后代的文本,按 /K(读取)顺序。
GetBBox(page: Page) → `[number, number, number, number]undefined`
Append(type: string, opts: ElemOpts) → StructElement在此元素下创建 type 的子结构元素;返回其句柄。
NextMcid(page: Page) → number为 page 在此元素上分配下一个 MCID,并连线 /ParentTree + /K。
MarkContent(page: Page, region: Rect) → number在此元素下标记已有页面内容:分配一个 MCID,并将内容位于 region 的顶层 show/Do 操作包装在 /<Type> <</MCID n>> BDC … EMC 中。
AddAnnotation(annotation: Annotation)标记注释(例如.
SetTableAttributes(attrs: Partial<TableAttributes>)将表属性合并到此元素的 /A 中(将字段设置为 undefined 会删除该键)。
SetListAttributes(attrs: Partial<ListAttributes>)将列表属性合并到此元素的 /A 中。
SetLayoutAttributes(attrs: Partial<LayoutAttributes>)将布局属性合并到此元素的 /A 中。
 中文