Skip to main content

HeaderFooterTemplate

Version: 11.0

cete.dynamicpdf.headerfootertemplate

HeaderFooterTemplate​

Represents a Header Footer Template of the page element.

public class HeaderFooterTemplate : Template
Public Class HeaderFooterTemplate
Inherits Template

Inheritance: Object → Template → HeaderFooterTemplate

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.Html;

public class Example
{
public static void CreatePDF(string inputHtmlPath, string outputPath)
{
// 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( inputHtmlPath );

// 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(outputPath);
}
}

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​

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​

The HeaderFooterText representing the header text of the page.

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​

The HeaderFooterText representing the header text of the page.

The HeaderFooterText representing the footer text of the page.

The Font representing font of the header footer text.

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​

Group

FooterCenter​

Gets or sets the center footer text for the page.

public HeaderFooterText FooterCenter { get; set; }
Public Property FooterCenter As HeaderFooterText

Property Value​

HeaderFooterText

FooterLeft​

Gets or sets the left footer text for the page.

public HeaderFooterText FooterLeft { get; set; }
Public Property FooterLeft As HeaderFooterText

Property Value​

HeaderFooterText

FooterRight​

Gets or sets the right footer text for the page.

public HeaderFooterText FooterRight { get; set; }
Public Property FooterRight As HeaderFooterText

Property Value​

HeaderFooterText

HeaderCenter​

Gets or sets the center header footer text for the page.

public HeaderFooterText HeaderCenter { get; set; }
Public Property HeaderCenter As HeaderFooterText

Property Value​

HeaderFooterText

HeaderLeft​

Gets or sets the left header text for the page.

public HeaderFooterText HeaderLeft { get; set; }
Public Property HeaderLeft As HeaderFooterText

Property Value​

HeaderFooterText

HeaderRight​

Gets or sets the right header text for the page.

public HeaderFooterText HeaderRight { get; set; }
Public Property HeaderRight As HeaderFooterText

Property Value​

HeaderFooterText

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​

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​

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​

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 .

See Also​

ceTe.DynamicPDF