I just used mPDF on my project and now stuck on this problem. First let me describe my PDF structure:
So the problem is :
Below is the code is used to include header and footer
$mpdf->SetHeader('{DATE j-m-Y}|{PAGENO}/2|My document');
$mpdf->SetFooter('{PAGENO}'); /* defines footer for Odd and Even Pages - placed at Outer margin */
$mpdf->SetFooter(array(
'L' => array(
'content' => 'Text to go on the left',
'font-family' => 'sans-serif',
'font-style' => 'B', /* blank, B, I, or BI */
'font-size' => '10', /* in pts */
),
'C' => array(
'content' => '- {PAGENO} -',
'font-family' => 'serif',
'font-style' => 'BI',
'font-size' => '18', /* gives default */
),
'R' => array(
'content' => 'Printed @ {DATE j-m-Y H:m}',
'font-family' => 'monospace',
'font-style' => '',
'font-size' => '10',
),
'line' => 1, /* 1 to include line below header/above footer */
), 'E' /* defines footer for Even Pages */
);
And for TOC page, I add this tag in the html
<tocpagebreak />
You can setup your footer to be invisible at first, and then reset it when you want the numbering to start. For example (using html tags):
<!-- sets up the footer -->
<pagefooter name="footer" content-center="{PAGENO}"></pagefooter>
<!-- disables it -->
<setpagefooter value="off"></setpagefooter>
<p>Some content for the first pages</p>
<!-- activates the footer and resets the numbering -->
<pagebreak odd-footer-name="footer" odd-footer-value="on" resetpagenum="1"></pagebreak>
I'm pretty sure the same can be achieved using the equivalent mpdf methods.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With