mPDF Manual – mPDF functions

AliasNbPages()

(mPDF >= 1.0)

AliasNbPages – Defines the placeholder used to insert total number of pages into the document

Description

void AliasNbPages ( string $text )

Set the value for the variable string aliasNbPg which is used as a placeholder used to insert total number of pages into the document.

Parameters

$text

Defines the text for the vaiable $aliasNbPg.

DEFAULT: {nb}

Examples

Example #1

<?php

$mpdf = new mPDF();

$mpdf->AliasNbPages('[pagetotal]');

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

$mpdf->Output();

?>

Example #2

<?php

$mpdf->AliasNbPages('[pagetotal]');

is the exact equivalent of:

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

See Also