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:

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

AlternateNameGets or sets the Name of the WaterMark.
(Inherited from Watermark)
AngleGets or sets the heights of the angle of the WaterMark.
(Inherited from Watermark)
AutoScaleGets or sets the AutoScale Property of the WaterMark.
FontGets or sets the Font object to use for the text of the WaterMark.
FontSizeGets or sets the font size for the text of the WaterMark.
IDGets or sets the ID of the page element.
(Inherited from PageElement)
IgnoreMarginsGets or sets ignore margin property. Setting false will consider the margin while placing the page element based on the RelativeTo property.
(Inherited from PageElement)
NameGets or sets the Name of the WaterMark.
(Inherited from Watermark)
OpacityGets or sets the opacity of the WaterMark.
(Inherited from Watermark)
PositionGets or sets the Position of the WaterMark.
(Inherited from Watermark)
RelativeToGets and sets placement of the page element on the page.
(Inherited from PageElement)
ScalingPercentageGets or sets the Scale Percentage of the WaterMark.
StrikethroughGets or sets the strike through to use for the text of the WaterMark.
TagGets or sets the tag of the taggable element.
(Inherited from TaggablePageElement)
TagOrderGets or sets the tag order of the taggable element.
(Inherited from TaggablePageElement)
TextGets or sets the Text of the WaterMark.
TextColorGets or sets the Color object to use for the text of the WaterMark.
TextOutlineColorGets or sets the Color object to use for the text outline of the WaterMark.
TextOutlineWidthGets or sets the line width to use for the text outline of the WaterMark.
UnderlineGets or sets a value indicating if the WaterMark is underlined.
XOffsetGets or sets the Horizontal Distance of the WaterMark.
(Inherited from Watermark)
YOffsetGets 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)

See Also

ceTe.DynamicPDF.PageElements

In this topic