WatermarkArtifact
概述
WatermarkArtifact 是 Aspose.PDF FOSS 用于 .NET 的一个类。继承自:Artifact。
表示可以添加到 PDF 页面上的水印工件。
此类提供 19 个方法,用于在 .NET 程序中处理 WatermarkArtifact 对象。可用的方法包括:AddToPage、Artifact、BeginUpdates、Dispose、GetValue、RemoveValue、SaveUpdates、SetImage、SetLinesAndState、SetPageNumberReplacementString、SetPdfPage、SetText,以及另外 3 个方法。安装 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 (e.g. |
Image | XImage? | 读取 | 当其内容为光栅图像时,支撑此工件的 Image XObject。 |
方法
| 签名 | 描述 |
|---|---|
WatermarkArtifact() | 创建一个 Watermark 工件的实例。 |
SetTextAndState(text: string, state: TextState) | 设置水印的文本和文本状态。 |
SetText(formattedText: Aspose.Pdf.Facades.FormattedText) | 从 FormattedText 对象设置水印文本(Facades API-style helper)。 |
AddToPage(page: Page) | 将此工件添加到页面。 |
Artifact() | 默认构造函数 — 创建一个类型和子类型为 Undefined 的工件。 |
Artifact(type: ArtifactType, subType: ArtifactSubtype) | 创建具有给定类型和子类型的工件。 |
Artifact(type: string, subType: string) | 创建具有基于字符串的自定义类型和子类型的工件。 |
SetPageNumberReplacementString(value: string) | 设置在 Text 中使用的页码替换标记。 |
SetLinesAndState(text: string[], textState: TextState) | 使用给定的文本状态设置多行文本内容。 |
BeginUpdates() | 开始批量属性更新。 |
SaveUpdates() | 刷新由 BeginUpdates 启动的批量更新。 |
Dispose() | 释放工件持有的资源。 |
GetValue(name: string) | 读取通过 SetValue(string, string) 设置的自定义名称/值对。 |
SetValue(name: string, value: string) | 在构件上存储自定义名称/值对(用于下游元数据访问;在此构建中不输出到 PDF)。 |
RemoveValue(name: string) | 移除先前通过 SetValue 设置的自定义名称/值对。 |
SetImage(imageStream: Stream) | 将光栅图像附加到构件上。 |
SetImage(imageName: string) | 通过路径附加栅格图像。 |
SetText(formattedText: FormattedText) | 从 FormattedText 实例设置工件文本。 |
SetPdfPage(page: Page) | 将此工件绑定到特定页面。 |