Question

I have a 'report' with more than 30 pages. I need to place the mPDF ToC at the 3th page but I need that following page to be showed as 4th page at ToC, not 3th page as mPDF does.

Now I have:

Page - Subject
01 - Front
02 - Notes
03 - ToC <<<< Plz, note the page number
04 - First useful topic
05 - [Other]

But my ToC is showed this way:

First Useful Topic ............... 03
[Other]........................... 04

The counting is clearly wrong. I need it to be:

First Useful Topic ............... 04
[Other]........................... 05

How can I accomplish it in mPDF, please?

Thank you so much.

Was it helpful?

Solution

I assume you're simply inserting your TOC as follows:

$mpdf->TOCpagebreak();

You can reset the page number of 4 using

$mpdf->WriteHTML('<pagebreak resetpagenum="4" suppress="off" />');

right before you write the content for page 4

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top