Click or drag to resize

HtmlHeaderFooter Fields

The HtmlHeaderFooter type exposes the following members.

Fields
  NameDescription
Public fieldBaseUrl
The Base URL all URLS in the HtmlFragment will be relative to. This includes 'src' attributes 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

HtmlFragment is a stand alone HTML document which does not inherit styles or settings from your main HTML content unless LoadStylesAndCSSFromMainHtmlDocument is set true

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 fieldLoadStylesAndCSSFromMainHtmlDocument
Loads style code blocks and links to CSS style sheets from the main HTML document (which provides the PDF content) into the HtmlHeaderFooter .

By default, Html Headers and Footers are stand-alone HTML documents with their own default styles. Setting LoadStylesAndCSSFromMainHtmlDocument to true will attempt to load all STYLE and LINK tags from the main HTML document (which renders teh PDF) into the HtmlHeaderFooter.

If your main HTML document contains complex CSS frameworks, styles the HEAD or BODY element heavily or loads CSS from javascript then this method may not work as intended.

This feature is not available for RenderUrlAsPdf(String) and other RenderUrlAsPdf methods. It works for HTMLToPdf and HtmlFileToPdf conversions only.

It is often preferable to load style sheets explicitly into your HTML Headers and Footers as STYLE and LINK tags within the HtmlFragment for granular control

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