cete.dynamicpdf.headerfootertemplate
HeaderFooterTemplate
- Namespace: ceTe.DynamicPDF
- Assemblies: ceTe.DynamicPDF.40.dll
Represents a Header Footer Template of the page element.
public class HeaderFooterTemplate : Template
Public Class HeaderFooterTemplate
Inherits Template
Inheritance: Object → Template → HeaderFooterTemplate
Licensing
This class is a DynamicPDF Generator Community Edition feature.
Examples
This example shows simple Header Footer Text being displayed on the page.
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Imports ceTe.DynamicPDF.PageElements.Html
Module MyModule
Sub Main()
' Create a PDF Document
Dim MyDocument As Document = New Document
' Create Header Footer Template
Dim MyHeader As HeaderFooterTemplate = New HeaderFooterTemplate("HeaderText", "FooterText")
document.Template = MyHeader
' Create a Uri
Dim MyFilePath As Uri = New Uri("C:\Temp\TestPage.html")
' Create a html area
Dim MyHtmlArea As HtmlArea = New HtmlArea(MyFilePath, 0, 0, 500, 600)
'Create a page
Dim MyPage As Page = New Page()
' Add the html area to the page
MyPage.Elements.Add(MyHtmlArea)
' Add the page to the document
MyDocument.Pages.Add(MyPage)
' Save the PDF document
MyDocument.Draw("C:\MyDocument.pdf")
End Sub
End Module
using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;
using ceTe.DynamicPDF.PageElements.Html;
class MyClass
{
static void Main()
{
// Create a PDF Document
Document document = new Document();
// Create Header Footer Template
HeaderFooterTemplate header = new HeaderFooterTemplate("HeaderText", "FooterText");
document.Template = header;
// Create a Uri
Uri filePath = new Uri( @"C:\Temp\TestPage.html");
// Create a html area
HtmlArea htmlArea = new HtmlArea(filePath, 0, 0, 500, 600);
//Create a page
Page page = new Page();
// Add the html area to the page;
page.Elements.Add(htmlArea);
// Add the page to the document
document.Pages.Add(page);
// Save the PDF
document.Draw("output.pdf");
}
}
Remarks
This class can be used to place Header Footer Template on a page.
Constructors
HeaderFooterTemplate()
Initializes a new instance of the HeaderFooterTemplate class.
public HeaderFooterTemplate()
Public Sub New ()
HeaderFooterTemplate(String)
Initializes a new instance of the HeaderFooterTemplate class.
public HeaderFooterTemplate(string footerText)
Public Sub New (footerText As String)
Parameters
- footerText: String
The HeaderFooterText representing the footer text of the page.
HeaderFooterTemplate(String, String)
Initializes a new instance of the HeaderFooterTemplate class.
public HeaderFooterTemplate(string headerText, string footerText)
Public Sub New (headerText As String, footerText As String)
Parameters
- headerText: String
The HeaderFooterText representing the header text of the page.
- footerText: String
The HeaderFooterText representing the footer text of the page.
HeaderFooterTemplate(String, String, Font, Single)
Initializes a new instance of the HeaderFooterTemplate class.
public HeaderFooterTemplate(string headerText, string footerText, Font font, float fontsize)
Public Sub New (headerText As String, footerText As String, font As Font, fontsize As Single)
Parameters
- headerText: String
The HeaderFooterText representing the header text of the page.
- footerText: String
The HeaderFooterText representing the footer text of the page.
- font: Font
The Font representing font of the header footer text.
- fontsize: Single
The font size representing size of the header footer text.
Properties
Elements
Gets the page elements that will be applied by the template to all pages. (Inherited from Template)
public Group Elements { get; }
Public Property Elements As Group
Property Value
FooterCenter
Gets or sets the center footer text for the page.
public HeaderFooterText FooterCenter { get; set; }
Public Property FooterCenter As HeaderFooterText
Property Value
FooterLeft
Gets or sets the left footer text for the page.
public HeaderFooterText FooterLeft { get; set; }
Public Property FooterLeft As HeaderFooterText
Property Value
FooterRight
Gets or sets the right footer text for the page.
public HeaderFooterText FooterRight { get; set; }
Public Property FooterRight As HeaderFooterText
Property Value
HeaderCenter
Gets or sets the center header footer text for the page.
public HeaderFooterText HeaderCenter { get; set; }
Public Property HeaderCenter As HeaderFooterText
Property Value
HeaderLeft
Gets or sets the left header text for the page.
public HeaderFooterText HeaderLeft { get; set; }
Public Property HeaderLeft As HeaderFooterText
Property Value
HeaderRight
Gets or sets the right header text for the page.
public HeaderFooterText HeaderRight { get; set; }
Public Property HeaderRight As HeaderFooterText
Property Value
Methods
Draw(PageWriter)
Draws the header footer template's page elements to the given PageWriter object.
public void Draw(PageWriter writer)
Sub Draw(writer As PageWriter)
Parameters
- writer: PageWriter
PageWriter object to receive the template'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
- obj: Object
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.
HasPageElements(Int32)
Returns a value indicating if the template has page elements for the given page. (Inherited from Template)
public bool HasPageElements(int pageNumber)
Function HasPageElements(pageNumber As Integer) As Boolean
Parameters
- pageNumber: Int32
Page number to test.
Returns
A Boolean value indicating if there are page elements.
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 .