Skip to main content

TextWatermark

Version: 9.0

cete.dynamicpdf.pageelements.textwatermark

TextWatermark​

Represents a Text Watermark.

public class TextWatermark : Watermark, IAnnotation, ISerializable
Public Class TextWatermark
Inherits Watermark
Implements IAnnotation, ISerializable

Inheritance: Object → PageElement → TaggablePageElement → Watermark → TextWatermark

Implements: IAnnotation, ISerializable

Licensing​

This class is a DynamicPDF Generator Professional Edition feature. One of the following licenses is required for non-evaluation usage:

  • DynamicPDF Generator for .NET Professional Edition
  • DynamicPDF Generator for .NET Enterprise Edition
  • DynamicPDF Merger for .NET Professional Edition
  • DynamicPDF Merger for .NET Enterprise Edition
  • DynamicPDF ReportWriter for .NET Professional Edition
  • DynamicPDF ReportWriter for .NET Enterprise Edition
  • DynamicPDF Core Suite for .NET Professional Edition
  • DynamicPDF Core Suite for .NET Enterprise Edition

Examples​

The following example will place a Text Watermark on the PDF.

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;

class MyClass
{
static void Main()
{
// 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( @"C:\MyDocument.pdf" );
}
}

Remarks​

This class can be used to place Text Watermark on the PDF.

Constructors​

TextWatermark(String)​

Initializes a new instance of the TextWatermark class.

public TextWatermark(string text)
Public Sub New (text As String)

Parameters​

Text to display in the Watermark.

TextWatermark(String, Font)​

Initializes a new instance of the TextWatermark class.

public TextWatermark(string text, Font font)
Public Sub New (text As String, font As Font)

Parameters​

Text to display in the Watermark.

Font for the text of the Watermark.

TextWatermark(String, Font, Single)​

Initializes a new instance of the TextWatermark class.

public TextWatermark(string text, Font font, float fontSize)
Public Sub New (text As String, font As Font, fontSize As Single)

Parameters​

Text to display in the Watermark.

Font for the text of the Watermark.

Font size of the text of the Watermark.

Properties​

AlternateName​

Gets or sets the Name of the WaterMark. (Inherited from Watermark)

public string AlternateName { get; set; }
Public Property AlternateName As String

Property Value​

String

Angle​

Gets or sets the heights of the angle of the WaterMark. (Inherited from Watermark)

public float Angle { get; set; }
Public Property Angle As Single

Property Value​

Single

AutoScale​

Gets or sets the AutoScale Property of the WaterMark.

public bool AutoScale { get; set; }
Public Property AutoScale As Boolean

Property Value​

Boolean

Font​

Gets or sets the Font object to use for the text of the WaterMark.

public Font Font { get; set; }
Public Property Font As Font

Property Value​

Font

FontSize​

Gets or sets the font size for the text of the WaterMark.

public float FontSize { get; set; }
Public Property FontSize As Single

Property Value​

Single

ID​

Gets or sets the ID of the page element. (Inherited from PageElement)

public string ID { get; set; }
Public Property ID As String

Property Value​

String

Name​

Gets or sets the Name of the WaterMark. (Inherited from Watermark)

public string Name { get; set; }
Public Property Name As String

Property Value​

String

Opacity​

Gets or sets the opacity of the WaterMark. (Inherited from Watermark)

public float Opacity { get; set; }
Public Property Opacity As Single

Property Value​

Single

Position​

Gets or sets the Position of the WaterMark. (Inherited from Watermark)

public WatermarkPosition Position { get; set; }
Public Property Position As WatermarkPosition

Property Value​

WatermarkPosition

ScalingPercentage​

Gets or sets the Scale Percentage of the WaterMark.

public int ScalingPercentage { get; set; }
Public Property ScalingPercentage As Int32

Property Value​

Int32

Strikethrough​

Gets or sets the strike through to use for the text of the WaterMark.

public bool Strikethrough { get; set; }
Public Property Strikethrough As Boolean

Property Value​

Boolean

Tag​

Gets or sets the tag of the taggable element. (Inherited from TaggablePageElement)

public Tag Tag { get; set; }
Public Property Tag As Tag

Property Value​

Tag

Licensing​

This property is a DynamicPDF Generator Enterprise Edition feature. One of the following licenses is required for non-evaluation usage:

  • DynamicPDF Generator for .NET Enterprise Edition
  • DynamicPDF Merger for .NET Enterprise Edition
  • DynamicPDF ReportWriter for .NET Enterprise Edition
  • DynamicPDF Core Suite for .NET Enterprise Edition

TagOrder​

Gets or sets the tag order of the taggable element. (Inherited from TaggablePageElement)

public int TagOrder { get; set; }
Public Property TagOrder As Int32

Property Value​

Int32

Text​

Gets or sets the Text of the WaterMark.

public string Text { get; set; }
Public Property Text As String

Property Value​

String

TextColor​

Gets or sets the Color object to use for the text of the WaterMark.

public Color TextColor { get; set; }
Public Property TextColor As Color

Property Value​

Color

TextOutlineColor​

Gets or sets the Color object to use for the text outline of the WaterMark.

public Color TextOutlineColor { get; set; }
Public Property TextOutlineColor As Color

Property Value​

Color

TextOutlineWidth​

Gets or sets the line width to use for the text outline of the WaterMark.

public float TextOutlineWidth { get; set; }
Public Property TextOutlineWidth As Single

Property Value​

Single

Underline​

Gets or sets a value indicating if the WaterMark is underlined.

public bool Underline { get; set; }
Public Property Underline As Boolean

Property Value​

Boolean

XOffset​

Gets or sets the Horizontal Distance of the WaterMark. (Inherited from Watermark)

public float XOffset { get; set; }
Public Property XOffset As Single

Property Value​

Single

YOffset​

Gets or sets the Vertical Distance of the WaterMark. (Inherited from Watermark)

public float YOffset { get; set; }
Public Property YOffset As Single

Property Value​

Single

Methods​

Draw(PageWriter)​

Draws the textWatermark to the given PageWriter object.

public void Draw(PageWriter writer)
Sub Draw(writer As PageWriter)

Parameters​

PageWriter object to receive the textWatermark's output.

DrawAnnotation(DocumentWriter)​

Draws the textWatermark to the given DocumentWriter object.

public void DrawAnnotation(DocumentWriter writer)
Sub DrawAnnotation(writer As DocumentWriter)

Parameters​

DocumentWriter object to receive the textWatermark's output.

Equals(Object)​

Determines whether the specified Object is equal to the current Object . (Inherited from Object)

public bool Equals(Object obj)
Function Equals(obj As Object) As Boolean

Parameters​

The Object to compare with the current Object .

Returns​

true if the specified Object is equal to the current Object ; otherwise, false.

GetHashCode()​

Serves as a hash function for a particular type. (Inherited from Object)

public int GetHashCode()
Function GetHashCode() As Integer

Returns​

A hash code for the current Object .

GetType()​

Gets the Type of the current instance. (Inherited from Object)

public Type GetType()
Function GetType() As Type

Returns​

The Type instance that represents the exact runtime type of the current instance.

ToString()​

Returns a String that represents the current Object . (Inherited from Object)

public string ToString()
Function ToString() As String

Returns​

A String that represents the current Object .

See Also​

ceTe.DynamicPDF.PageElements