mPDF Manual – mPDF Variables

aliasNbPgGp

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

Default: '{nbpg}'

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

Usage

Set at document initiation

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

Examples

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

$mpdf = new \Mpdf\Mpdf(['aliasNbPgGp' => '[pagegrouptotal]']);

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

$mpdf->Output();

See Also

Fork me on GitHub