Keep up to date with Gravity PDF

  • This field is for validation purposes and should be left unchanged.
This is the legacy Gravity PDF v3 documentation which is NOT supported. Go to the latest documentation.

Reserved Template 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.

Signup for the latest Gravity PDF news, tips and updates

  • This field is for validation purposes and should be left unchanged.
Scroll To Top

Choose your currency:

Close
Converted prices are for reference only - all orders are charged in $ Australian Dollars ($) AUD.
  • AUDAustralian Dollars ($)
  • USDUS Dollars ($)
  • CADCanadian Dollars ($)
  • EUREuros (€)
  • GBPPound Sterling (£)
  • NZDNew Zealand Dollar ($)
  • JPYJapanese Yen (¥)