Click or drag to resize

HtmlHeaderFooter Class

A Html Header or Footer which will be printed onto every page of the PDF. This can be used to override Header and Footer

When using HtmlHeaderFooter it is important to set HtmlFragment and Height

Merge meta-data into your html using any of these placeholder strings: {page} {total-pages} {url} {date} {time} {html-title} {pdf-title}

Inheritance Hierarchy

Namespace:  IronPdf
Assembly:  IronPdf (in IronPdf.dll) Version: 4.4.2.27556 (4.4.4.0)
Syntax
public class HtmlHeaderFooter : SimpleHeaderFooter

The HtmlHeaderFooter type exposes the following members.

Constructors
  NameDescription
Public methodHtmlHeaderFooter
Initializes a new instance of the HtmlHeaderFooter class
Top
Methods
  NameDescription
Public methodEquals (Inherited from Object.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Public methodToString (Inherited from Object.)
Top
Fields
  NameDescription
Public fieldBaseUrl
The Base URL all URLS in the HtmlFragment will be relative to. This includes src attributives on images, scripts, style-sheets and also hrefs on hyper-links.
Public fieldCenterText
Sets the centered header text for the PDF document.

Merge meta-data into your header using any of these placeholder strings: {page} {total-pages} {url} {date} {time} {html-title} {pdf-title}

(Inherited from SimpleHeaderFooter.)
Public fieldDrawDividerLine
Adds a horizontal line divider between the header / footer and the page content on every page of the PDF document.
(Inherited from SimpleHeaderFooter.)
Public fieldFontFamily
Font used to render the PDF header.
(Inherited from SimpleHeaderFooter.)
Public fieldFontSize
Font size in px.
(Inherited from SimpleHeaderFooter.)
Public fieldHeight
Height of the Html Header / Footer in millimeters. This value must be set sufficiently high to display the full html header / footer content.
Public fieldHtmlFragment
The Html which will be use to render the Header / Footer. Should be an HTML snippet rather than a complete document. May contain styles & images.

Merge meta-data into the HtmlFragment by putting any of these placeholder strings into the text: {page} {total-pages} {url} {date} {time} {html-title} {pdf-title}. An alternative mail-merge style using the pattern <span class='total-pages'></span> also workd

Public fieldLeftText
Sets the left hand side header text for the PDF document.

Merge meta-data into your header using any of these placeholder strings: {page} {total-pages} {url} {date} {time} {html-title} {pdf-title}

(Inherited from SimpleHeaderFooter.)
Public fieldRightText
Sets the right hand side header text for the PDF document.

Merge meta-data into your header using any of these placeholder strings: {page} {total-pages} {url} {date} {time} {html-title} {pdf-title}

(Inherited from SimpleHeaderFooter.)
Public fieldSpacing
Space between the header and page content in millimeters.
(Inherited from SimpleHeaderFooter.)
Top
See Also