mPDF Manual – Headers & Footers

Page headers and page footers can be set for mPDF documents in a number of different ways. As mPDF has evolved, new methods have been added.

## Types

RUNTIME
RUNTIME headers/footers are set as they are required throughout the document.
NAMED
NAMED headers/footers are defined at any time (before they are used) and given a ‘name’; they can then be used/re-used by reference to that name at any time. They can be defined by either PHP script or custom HTML tags.
Non-HTML
(deprecated) NON-HTML headers/footers are set by text strings with no HTML mark up to define styles. Style changes (font-size, font-family, color) can be defined by changing mPDF variables.
HTML
HTML headers/footers are written in standard HTML code. They can only be defined outside HTML block tags (except <body>).

## Methods

In any of the options, {PAGENO} or {DATE j-m-Y} can be used - which will be replaced by the page number or current date. j-m-Y can be replaced by any of the valid formats used in the PHP date() function.