TextWatermark
Represents a Text Watermark.
public class TextWatermark : Watermark, IAnnotation, ISerializable
Public Class TextWatermark
Inherits Watermark
Implements IAnnotation, ISerializable
Inheritance: ObjectPageElementTaggablePageElementWatermarkTextWatermark
Implements: IAnnotation, ISerializable
Licensing Info
This class is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Examples
The following example will place a Text Watermark on the page.Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Module MyModule
Sub Main()
' Create a PDF Document
Dim MyDocument As Document = New Document
' Create a Page and add it to the document
Dim MyPage As Page = New Page
MyDocument.Pages.Add(MyPage)
' Set PDF version to 1.6
MyDocument.PdfVersion = PdfVersion.v1_6
' Create the string and Text Watermark
Dim text As string = "This is a text watermark."
Dim twm As TextWatermark= new TextWatermark(text);
' Add the TextWatermark to the page
MyPage.Elements.Add(twm);
' Save the PDF
MyDocument.Draw("C:\MyDocument.pdf")
End Sub
End Module
using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;
public class Example
{
public static void CreatePDF(string outputPath)
{
// Create a PDF Document
Document document = new Document();
// Create a Page and add it to the document
Page page = new Page();
document.Pages.Add(page);
//Set PDF version to 1.6
document.PdfVersion = PdfVersion.v1_6;
// Create the string and Text Watermark
string text = "This is a text watermark.";
TextWatermark twm = new TextWatermark(text);
// Add the TextWatermark and the link to the page
page.Elements.Add(twm);
// Save the PDF
document.Draw(outputPath);
}
}
Remarks
This class can be used to place Text Watermark on the PDF.
Constructors
TextWatermark(String) | Initializes a new instance of the TextWatermark class. |
TextWatermark(String, Font) | Initializes a new instance of the TextWatermark class. |
TextWatermark(String, Font, Single) | Initializes a new instance of the TextWatermark class. |
Properties
AlternateName | Gets or sets the Name of the WaterMark. (Inherited from Watermark) |
Angle | Gets or sets the heights of the angle of the WaterMark. (Inherited from Watermark) |
AutoScale | Gets or sets the AutoScale Property of the WaterMark. |
Font | Gets or sets the Font object to use for the text of the WaterMark. |
FontSize | Gets or sets the font size for the text of the WaterMark. |
ID | Gets or sets the ID of the page element. (Inherited from PageElement) |
IgnoreMargins | Gets or sets ignore margin property. Setting false will consider the margin while placing the page element based on the RelativeTo property. (Inherited from PageElement) |
Name | Gets or sets the Name of the WaterMark. (Inherited from Watermark) |
Opacity | Gets or sets the opacity of the WaterMark. (Inherited from Watermark) |
Position | Gets or sets the Position of the WaterMark. (Inherited from Watermark) |
RelativeTo | Gets and sets placement of the page element on the page. (Inherited from PageElement) |
ScalingPercentage | Gets or sets the Scale Percentage of the WaterMark. |
Strikethrough | Gets or sets the strike through to use for the text of the WaterMark. |
Tag | Gets or sets the tag of the taggable element. (Inherited from TaggablePageElement) |
TagOrder | Gets or sets the tag order of the taggable element. (Inherited from TaggablePageElement) |
Text | Gets or sets the Text of the WaterMark. |
TextColor | Gets or sets the Color object to use for the text of the WaterMark. |
TextOutlineColor | Gets or sets the Color object to use for the text outline of the WaterMark. |
TextOutlineWidth | Gets or sets the line width to use for the text outline of the WaterMark. |
Underline | Gets or sets a value indicating if the WaterMark is underlined. |
XOffset | Gets or sets the Horizontal Distance of the WaterMark. (Inherited from Watermark) |
YOffset | Gets or sets the Vertical Distance of the WaterMark. (Inherited from Watermark) |
Methods
Draw(PageWriter) | Draws the TextWatermark to the given PageWriter object. |
DrawAnnotation(DocumentWriter) | Draws the TextWatermark to the given DocumentWriter object. |
Equals(Object) | Determines whether the specified Object is equal to the current Object . (Inherited from Object) |
GetHashCode() | Serves as a hash function for a particular type. (Inherited from Object) |
GetType() | Gets the Type of the current instance. (Inherited from Object) |
ToString() | Returns a String that represents the current Object . (Inherited from Object) |