mPDF Manual – mPDF Variables

nbpgSuffix

(mPDF ≥ 3.0)

Description

string nbpgPrefix

Specify text to follow the page total generated by {nbpg}.

Examples

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

$mpdf = new \Mpdf\Mpdf([
    'pagenumPrefix' => 'Page number ',
    'pagenumSuffix' => ' - ',
    'nbpgPrefix' => ' out of ',
    'nbpgSuffix' => ' pages'
]);

$mpdf->SetHeader('{PAGENO}{nbpg}');
$mpdf->WriteHTML("Hello World");

$mpdf->Output();

Will output a header:

“Page number 1 - out of 1 pages”

See Also

Fork me on GitHub