 |
PdfTemplateCollection Class |
Represents the collection of templates of a pdf document. A template is repeated on more than
one page of the pdf document. Reached via
Templates.
Inheritance HierarchySystemObject
SelectPdf.UniversalPdfTemplateCollection
Namespace: SelectPdf.UniversalAssembly: SelectPdf.Universal (in SelectPdf.Universal.dll) Version: 26.4
Syntaxpublic class PdfTemplateCollection : IEnumerable
Public Class PdfTemplateCollection
Implements IEnumerable
The PdfTemplateCollection type exposes the following members.
Properties| | Name | Description |
|---|
 | Count |
The number of templates added via Add(Single, Single) / Add(RectangleF).
|
 | Footer |
Represents the default pdf document footer template. It is automatically docked to the bottom
of the page and its height is reserved when laying out page content.
|
 | Header |
Represents the default pdf document header template. It is automatically docked to the top of
the page and its height is reserved when laying out page content.
|
 | Item |
Gets the template at the specified zero based index in the templates collection.
|
Top
Methods
ExamplePdfDocument doc = new PdfDocument();
doc.AddPage();
PdfTemplate header = doc.Templates.Add(doc.Pages[0].PageSize.Width, 40);
header.Add(new PdfTextElement(0, 10, "REPORT",
PdfFont.CreateStandardFont(PdfStandardFont.HelveticaBold, 14),
new PdfColor(0, 0, 0)));
doc.Templates.Header = header;
doc.Save("report.pdf");Dim doc As New PdfDocument()
doc.AddPage()
Dim header As PdfTemplate = doc.Templates.Add(doc.Pages(0).PageSize.Width, 40)
header.Add(New PdfTextElement(0, 10, "REPORT", _
PdfFont.CreateStandardFont(PdfStandardFont.HelveticaBold, 14), _
New PdfColor(0, 0, 0)))
doc.Templates.Header = header
doc.Save("report.pdf")
See Also