Definition of headers and footers with HTML is straightforward, the following specifics should be taken into account.

  • HTML header or footer definition data overrides pageNumberTemplate and titleTemplate properties and all other associated settings.
  • ${page}, ${total} and ${title} placeholders are populated as before with current page number, total number of pages and document title.
  • Base URL of the header/footer html is the same as the main HTML source.
PD4ML html = new PD4ML();
PD4PageMark header = new PD4PageMark();
header.setAreaHeight( 150 );
header.setHtmlTemplate( "<font face=\"Arial\" size=\"10\">" + 
       "<b>Header test</b><br>" + "${page} of ${total}</font>" );
html.setPageHeader( header );