(mPDF ≥ 3.0)
stringnbpgPrefix
Specify text to precede the page total generated by{nbpg}.
Note: This is only recommended in non-HTML headers and footers. Although the text is added correctly in HTML headers & footers, the text alignment is not readjusted after substitution e.g. if it used in the right margin.
<?php// Require composer autoloadrequire_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”