IllustrationElement
概述
IllustrationElement 是 Aspose.PDF FOSS 中用于 .NET 的类。继承自:StructureElement。
用于图示类结构元素(Figure, Formula)的抽象基类。
此类提供 15 个方法,用于在 .NET 程序中处理 IllustrationElement 对象。可用的方法包括:AdjustPosition, AppendChild, ChangeParentElement, ClearId, Detach, FindElements, RemoveAndMoveItsChildObjectsToItsParent, SetId, SetImage, SetTag, SetText, ToString。在安装 Aspose.PDF FOSS for .NET 包后,所有公共成员对任何 .NET 应用程序均可访问。属性:ActualText, AlternativeText, Attributes, ChildElements, ExpansionText, ID,以及另外 11 项。
属性
| 名称 | 类型 | 访问 | 描述 |
|---|---|---|---|
ImagePath | string? | 读取 | 此插图所使用的图像文件。 |
ImageWidth | double | 读取 | 图像宽度覆盖(0 = 自动)。 |
ImageHeight | double | 读取 | 图像高度覆盖(0 = 自动)。 |
Resolution | int | 读取 | 图像分辨率(DPI)覆盖(0 = 自动)。 |
StructureTextState | StructureTextState | 读取 | 对该元素内联内容应用的文本状态(仅存储——FOSS 结构构建器不会重新渲染)。 |
Attributes | StructureElementAttributes | 读取 | 该元素附带的结构属性(/A),按所有者组织。 |
StructureType | string | 读取 | PDF 结构类型角色(/S 条目,例如. |
S | StructureType | 读取 | 元素的结构类型(/S)作为一个 StructureType,其 Name 为角色标签(例如. |
ActualText | string | 读写 | 标记内容的替换文本(/ActualText)。 |
AlternativeText | string | 读写 | 辅助技术使用的备用文字(/Alt)。 |
ExpansionText | string | 读写 | 缩写的展开文本(/E)。 |
Language | string | 读写 | BCP-47 元素内容的语言代码 (/Lang)。 |
ID | string | 读取 | 元素标识符 (/ID);只读 — 在保存时分配。 |
Title | string | 读写 | 结构元素的标题 (/T)。 |
Page | Page? | 读取 | 承载此元素内容的页面;如果元素尚未附加到页面,则为 null。 |
ParentElement | StructureElement? | 读取 | 父结构元素;如果该元素已分离或直接位于结构树根部,则为 null。 |
ChildElements | ElementList | 读取 | 此元素的直接子元素。 |
方法
| 签名 | 描述 |
|---|---|
SetImage(imagePath: string) | 将 raster/vector 图片绑定到此插图。 |
SetImage(imagePath: string, width: double, height: double) | 绑定具有明确尺寸的图片。 |
SetImage(imagePath: string, resolution: int) | 绑定具有明确分辨率(DPI)的图片。 |
AppendChild(child: StructureElement) | 在此元素的 /K 数组下追加子项。 |
SetTag(tag: string) | 将此元素的角色重新映射为自定义标签,在文档角色映射中注册标签 → 其标准类型。 |
ToString() | 在转储结构树时使用的文本表示(角色名称;若不存在则回退为类型名称)。 |
FindElements(recursive: bool) | 递归查找类型为 T 的后代元素。 |
AppendChild(child: StructureElement, validate: bool) | 追加子元素,可选的验证过程。 |
SetText(text: string) | 设置元素的文本内容(存储为 ActualText)。 |
SetId(id: string) | 设置元素标识符 (/ID)。 |
ClearId() | 删除元素标识符 (/ID)。 |
AdjustPosition(settings: object) | 捕获为已编写结构元素请求的布局位置。 |
ChangeParentElement(newParent: StructureElement, validate: bool) | 将此元素移动到 newParent 下。 |
RemoveAndMoveItsChildObjectsToItsParent(validate: bool) | 将此元素分离,然后将其子元素重新归属到此元素原来的父元素下(占据此元素的位置)。 |
Detach() | 将此元素从其父元素中分离。 |