mPDF Manual – mPDF Variables

aliasNbPg

Variable which defines the text to be replaced by the total page number in the document.

Default: '{nb}'

You can assign this value directly, or use the function: AliasNbPages()

Usage

Set at document initiation

<?php
$mpdf = new \Mpdf\Mpdf(['aliasNbPg' => '[pagetotal]']);

Examples

<?php
// Require composer autoload
require_once __DIR__ . '/vendor/autoload.php';

$mpdf = new \Mpdf\Mpdf(['aliasNbPg' => '[pagetotal]']);

$mpdf->SetHeader('Your header [pagetotal]');
$mpdf->WriteHTML("Hello World");

$mpdf->Output();

See Also

Fork me on GitHub