HeaderArtifact
概述
HeaderArtifact 是 Aspose.PDF FOSS 中用于 .NET 的类。继承自:Artifact。
表示一个 header artifact —— 一个页面级的 running head,标记为 Artifact /Subtype /Header(PDF 32000 §14.8.2.2)。
此类提供 15 个方法,用于在 .NET 程序中处理 HeaderArtifact 对象。可用的方法包括:Artifact、BeginUpdates、Dispose、GetValue、HeaderArtifact、RemoveValue、SaveUpdates、SetImage、SetLinesAndState、SetPageNumberReplacementString、SetPdfPage、SetText,以及另外 2 个方法。所有公共成员在安装 Aspose.PDF FOSS for .NET 包后,可供任何 .NET 应用程序访问。属性:ArtifactHorizontalAlignment、ArtifactVerticalAlignment、BackgroundColor、BottomMargin、Contents、CustomSubtype,以及另外 18 项。
属性
| 名称 | 类型 | 访问 | 描述 |
|---|---|---|---|
Type | ArtifactType | 读写 | 工件的类型分类。 |
Subtype | ArtifactSubtype | 读写 | 工件的子类型。 |
CustomType | string? | 读写 | 非标准工件类型的名称。 |
CustomSubtype | string? | 读写 | 非标准工件子类型的名称。 |
Text | string? | 读写 | 从工件的内容流操作符提取的文本内容。 |
Rectangle | Rectangle? | 读取 | 属性字典中 /BBox 条目的边界框。 |
Opacity | double | 读写 | 工件的不透明度(来自 ExtGState /ca)。 |
Page | Page? | 读取 | 该工件所属的页面。 |
ArtifactHorizontalAlignment | HorizontalAlignment | 读写 | 水平对齐(来自 /Attached 条目)。 |
ArtifactVerticalAlignment | VerticalAlignment | 读写 | 垂直对齐(来自 /Attached 条目)。 |
IsBackground | bool | 读写 | 这是否是背景伪影。 |
Rotation | double | 读写 | 旋转角度(单位:度)。 |
BackgroundColor | Color? | 读写 | 背景颜色。 |
RightMargin | double | 读写 | 右边距。 |
LeftMargin | double | 读写 | 左边距。 |
TopMargin | double | 读写 | 上边距。 |
BottomMargin | double | 读写 | 底部边距。 |
Position | Point? | 读写 | 显式放置坐标。 |
FormattedText | FormattedText? | 读写 | 用于工件的格式化文本。 |
TextState | TextState? | 读写 | 文本状态用于工件文本。 |
Lines | List<string> | 读取 | 多行文本内容。 |
Contents | List<Operator> | 读取 | 内部内容流运算符用于绘制工件。 |
Form | XForm? | 读取 | 当此工件以可复用表单形式呈现时,支持它的 Form XObject(例如. |
Image | XImage? | 读取 | 当其内容为光栅图像时,支持此工件的 Image XObject。 |
方法
| 签名 | 描述 |
|---|---|
HeaderArtifact() | 创建一个空的页眉工件(分页 / 页眉)。 |
HeaderArtifact(text: string) | 创建一个携带给定文本的 header artifact。 |
Artifact() | 默认构造函数 — 创建一个类型和子类型为 Undefined 的工件。 |
SetPageNumberReplacementString(value: string) | 设置在 Text 中使用的页码替换标记。 |
SetLinesAndState(text: string[], textState: TextState) | 使用给定的文本状态设置多行文本内容。 |
BeginUpdates() | 开始批量属性更新。 |
SaveUpdates() | 刷新由 BeginUpdates 启动的批量更新。 |
Dispose() | 释放 artifact 持有的资源。 |
GetValue(name: string) | 读取通过 SetValue(string, string) 设置的自定义名称/值对。 |
SetValue(name: string, value: string) | 在 artifact 上存储自定义名称/值对(用于下游元数据访问;在此构建中不会输出到 PDF 中)。 |
RemoveValue(name: string) | 删除通过 SetValue 先前设置的自定义名称/值对。 |
SetImage(imageStream: Stream) | 将光栅图像附加到工件。 |
SetText(formattedText: FormattedText) | 从 FormattedText 实例设置工件文本。 |
SetTextAndState(text: string, textState: TextState) | 将 Text 与 TextState 一起设置。 |
SetPdfPage(page: Page) | 将此工件绑定到特定页面。 |