Skip to main content
Version: 3

Reserved Variables

mPDF has a number of reserved keywords that can be placed in your HTML templates that allows you to output the page number, total document pages, the date, and the sum of a table's column.

VariableDescription
{nb?}Will return the total number of pages in the PDF document.
{PAGENO}Will be replaced by the current page number. Only available in the header or footer.
{DATE d/m/Y}Will be replaced by today's date. The date format can use any value that PHP's date() function uses. Only available in the header or footer. We advice you use the date passed through the $form_data array instead.
{colsum}, {colsumN}The total values in the corresponding column will output at the end of the table. Only available in a table footer - <tfoot><td>{colsum}</td></tfoot>. Note: An optional integer N parameter will specify a fixed number of decimal places.

For the full details about reserved template variables view the mPDF documentation.