ImageWatermark

Represents a Image Watermark.

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

Inheritance: ObjectPageElementTaggablePageElementWatermarkImageWatermark

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 Image 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 an image for the watermark
        Dim imageWm As ImageWatermark = new ImageWatermark(@"test.png")
             
        ' Add the image watermark to the page
        MyPage.Elements.Add(imageWm);
            
        ' 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, string imagePath)
    {
        // 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 an image for the watermark
        ImageWatermark imageWm = new ImageWatermark(imagePath);

        // Add the image watermark to the page
        page.Elements.Add(imageWm);

        // Save the PDF
        document.Draw(outputPath);
    }
}

Remarks

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

Constructors

ImageWatermark(Byte[])Initializes a new instance of the ImageWatermark class.
ImageWatermark(ImageData)Initializes a new instance of the ImageWatermark class.
ImageWatermark(String)Initializes a new instance of the ImageWatermark 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)
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)
ImageDataGets or sets ImageData .
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)
ScaleXGets or sets the horizontal scale of the image.
ScaleYGets or sets the vertical scale of the image.
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)
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 ImageWatermark to the given PageWriter object.
DrawAnnotation(DocumentWriter)Draws the ImageWatermark 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