I have an application and need to print a document using the MPDF class, however necessary that the number of page start at number 43, 44, 45 and so on.
And not from the 1, 2, 3 ...
I managed to start from the 43 but only jumping a leaf. I can not insert a pagebreak.
Thanks.
Below is my code.
$mpdf = new mPDF();
$mpdf->setFooter("{PAGENO}");
$numero_paginas = "{nb}";
$mpdf->SetHTMLHeader('
<table>
<tr>
<td>
<img src="img/cabecalho.png" />
</td>
</tr>
</table>
<hr>
');
$mpdf->SetHTMLFooter('');
$mpdf->WriteHTML('
<style type="text/css">
body{
font-family:Arial, Times New Roman, sans-serif;
font-size:10px;
}
</style>
' . $corpo_documento . '');
$mpdf->Output();
exit;
Also, if you're adding a page by sending in an array of arguments, you can set it to 43 by setting
'resetpagenum' => '43'
From mPDF manual on page numbers:
So, call
AddPage()
after setting the footer like this: