WatermarkArtifact
Overview
WatermarkArtifact is a class in Aspose.PDF FOSS for .NET.
Inherits from: Artifact.
Represents a watermark artifact that can be added to a PDF page.
This class provides 15 methods for working with WatermarkArtifact objects in .NET programs.
Available methods include: AddToPage, Artifact, BeginUpdates, Dispose, GetValue, RemoveValue, SaveUpdates, SetImage, SetLinesAndState, SetPageNumberReplacementString, SetPdfPage, SetText, and 3 additional methods.
All public members are accessible to any .NET application after installing the Aspose.PDF FOSS for .NET package.
Properties: ArtifactHorizontalAlignment, ArtifactVerticalAlignment, BackgroundColor, BottomMargin, Contents, CustomSubtype, and 18 more.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
Type | ArtifactType | Read/Write | The artifact’s type classification. |
Subtype | ArtifactSubtype | Read/Write | The artifact’s subtype. |
CustomType | string? | Read/Write | Name of non-standard artifact type. |
CustomSubtype | string? | Read/Write | Name of non-standard artifact subtype. |
Text | string? | Read/Write | Text content extracted from the artifact’s content stream operators. |
Rectangle | Rectangle? | Read | Bounding box from the /BBox entry in the properties dictionary. |
Opacity | double | Read/Write | Opacity of the artifact (from ExtGState /ca). |
Page | Page? | Read | The page this artifact belongs to. |
ArtifactHorizontalAlignment | HorizontalAlignment | Read/Write | Horizontal alignment (from /Attached entry). |
ArtifactVerticalAlignment | VerticalAlignment | Read/Write | Vertical alignment (from /Attached entry). |
IsBackground | bool | Read/Write | Whether this is a background artifact. |
Rotation | double | Read/Write | Rotation angle in degrees. |
BackgroundColor | Color? | Read/Write | Background color. |
RightMargin | double | Read/Write | Right margin. |
LeftMargin | double | Read/Write | Left margin. |
TopMargin | double | Read/Write | Top margin. |
BottomMargin | double | Read/Write | Bottom margin. |
Position | Point? | Read/Write | Explicit placement coordinates. |
FormattedText | FormattedText? | Read/Write | Formatted text for the artifact. |
TextState | TextState? | Read/Write | Text state for artifact text. |
Lines | List<string> | Read | Multi-line text content. |
Contents | List<Operator> | Read | Internal content-stream operators that draw the artifact. |
Form | XForm? | Read | The Form XObject backing this artifact when it is rendered as a reusable form (e.g. |
Image | XImage? | Read | The Image XObject backing this artifact when its content is a raster image. |
Methods
| Signature | Description |
|---|---|
WatermarkArtifact() | Creates an instance of a Watermark artifact. |
SetTextAndState(text: string, state: TextState) | Set the text and text state for the watermark. |
SetText(formattedText: Aspose.Pdf.Facades.FormattedText) | Set watermark text from a FormattedText object (Facades API-style helper). |
AddToPage(page: Page) | Add this artifact to a page. |
Artifact() | Default constructor — creates an artifact with Undefined type and subtype. |
SetPageNumberReplacementString(value: string) | Sets the page-number replacement token used in Text. |
SetLinesAndState(text: string[], textState: TextState) | Sets multi-line text content with the given text state. |
BeginUpdates() | Begin a batched property update. |
SaveUpdates() | Flush a batched update started by BeginUpdates. |
Dispose() | Releases resources held by the artifact. |
GetValue(name: string) | Read a custom name/value pair set via SetValue(string, string). |
SetValue(name: string, value: string) | Store a custom name/value pair on the artifact (for downstream metadata access; not emitted into the PDF in this build). |
RemoveValue(name: string) | Remove a custom name/value pair previously set via SetValue. |
SetImage(imageStream: Stream) | Attach a raster image to the artifact. |
SetPdfPage(page: Page) | Bind this artifact to a specific page. |