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:
- 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 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
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) |
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) |
ImageData | Gets or sets ImageData . |
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) |
ScaleX | Gets or sets the horizontal scale of the image. |
ScaleY | Gets or sets the vertical scale of the image. |
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) |
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 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) |