mPDF Manual – mPDF Variables

pagenumPrefix

(mPDF >= 3.0)

Description

string pagenumPrefix

Specify text to precede the page number when using {PAGENO} to insert page numbers in headers or footers.

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