mPDF Manual – mPDF functions

AliasNbPageGroups()

(mPDF ≥ 2.0)

AliasNbPageGroups – Defines the placeholder used to insert total page number of the page group or document into the document

Description

void AliasNbPageGroups ( string $text )

Set the value for the variable string aliasNbPgGp which is used as a placeholder used to insert total page number into the document. If you have reset the page numbering with AddPage() or <pagebreak> the total number of pages in the current page group will be used (up to where the numbering is reset) rather the total number of pages in the whole document.

Parameters

$text

Defines the text for the variable $aliasNbPgGp.

Default: '{nbpg}'

Examples

Example #1

<?php
$mpdf = new \Mpdf\Mpdf();

$mpdf->AliasNbPageGroups('[pagetotal]');
$mpdf->WriteHTML('
There are [pagetotal] pages in this page group
');

$mpdf->Output();


Example #2

<?php
$mpdf->AliasNbPageGroups('[pagetotal]');

is the exact equivalent of:

$mpdf->aliasNbPgGp = '[pagetotal]';

See Also

Fork me on GitHub