nbpgPrefix
(mPDF ≥ 3.0)
Description
string nbpgPrefix
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.
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
- pagenumPrefix - Specify text to precede page numbers generated by {PAGENO}
- pagenumSuffix - Specify text to follow page numbers generated by {PAGENO}
- nbpgSuffix - Specify text to follow page numbers generated by {nbpg }
- Page numbering -
- Replaceable aliases -
- aliasNbPg - Specify the text to be replaced by the document page total
- aliasNbPgGp - Specify the text to be replaced by the group page total