Skip to main content

ImageWatermark

Version: 10.0

cete.dynamicpdf.pageelements.imagewatermark

ImageWatermark​

Represents a Image Watermark.

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

Inheritance: Object → PageElement → TaggablePageElement → Watermark → ImageWatermark

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 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(ImageData)​

Initializes a new instance of the ImageWatermark class.

public ImageWatermark(ImageData imageData)
Public Sub New (imageData As ImageData)

Parameters​

ImageData object containing the image data.

ImageWatermark(String)​

Initializes a new instance of the ImageWatermark class.

public ImageWatermark(string filePath)
Public Sub New (filePath As String)

Parameters​

Physical file path of the image.

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

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

ImageData​

Gets or sets ImageData .

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

Property Value​

ImageData

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

ScaleX​

Gets or sets the horizontal scale of the image.

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

Property Value​

Single

ScaleY​

Gets or sets the vertical scale of the image.

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

Property Value​

Single

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

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 ImageWatermark to the given PageWriter object.

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

Parameters​

PageWriter object to receive the imageWatermark's output.

DrawAnnotation(DocumentWriter)​

Draws the ImageWatermark 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