Click or drag to resize
Pdf Library for .NET

PdfTemplateCollectionAdd(Single, Single) Method

Adds a new template with the specified width and height. The template location is the top-left corner of the page; use Add(RectangleF) to specify another location.

Namespace: SelectPdf.Universal
Assembly: SelectPdf.Universal (in SelectPdf.Universal.dll) Version: 26.4
Syntax
public PdfTemplate Add(
	float width,
	float height
)

Parameters

width  Single
The template width, in points.
height  Single
The template height, in points.

Return Value

PdfTemplate
The newly created template.
Example
PdfTemplate watermark = doc.Templates.Add(200, 40);
watermark.Add(new PdfTextElement(0, 0, "DRAFT",
    PdfFont.CreateStandardFont(PdfStandardFont.HelveticaBold, 24),
    new PdfColor(220, 30, 30)));
See Also