Movatterモバイル変換


[0]ホーム

URL:


mPDF Manual – mPDF Variables

nbpgPrefix

(mPDF ≥ 3.0)

Description

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.

Examples

<?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”

See Also


[8]ページ先頭

©2009-2026 Movatter.jp