You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I spent a couple of hours wondering why I could not get the right footer on my TOC... even toc-odd-footer-value and toc-even-footer-value set to off or -1 wouldn't work.
In the end, it turns out, whatever your header and footings setting are on the last page of your document, are what header and footer are displayed on your TOC. I think this is because it is generated at the end of the document, and then inserted back where you defined it near the start.
So, as a work around, I just ended up setting a different header and footer for the last page of the document.
MPDF refuses to display the correct footer on the TOC pages, neither SetHTMLFooterByName() or toc-odd-footer-name="" works as expected.
My order is
front page - header 1 footer 1
toc pages - header 2 footer 2
pages after - header 2 footer 3
$mpdf -> DefHTMLHeaderByName('header1', 'Header 1');
$mpdf -> DefHTMLHeaderByName('header2', 'Header 2');
$mpdf -> DefHTMLFooterByName('footer1', 'Footer 1');
$mpdf -> DefHTMLFooterByName('footer2', 'Footer 2');
$mpdf -> DefHTMLFooterByName('footer3', 'Footer 3');
$mpdf -> SetHTMLHeaderByName('header1');
$mpdf -> WriteHTML('Front Page');
$mpdf -> SetHTMLFooterByName('footer1');
$mpdf -> SetHTMLHeaderByName('header2');
// THIS
$mpdf -> TOCpagebreak();
$mpdf -> SetHTMLFooterByName('footer2');
// OR THIS
$mpdf -> WriteHTML('<tocpagebreak toc-resetpagenum="1" type="NEXT-ODD" toc-odd-footer-name="footer2" *'); // * with closing
$mpdf -> WriteHTML('pages after');
$mpdf -> SetHTMLFooterByName('footer3');
The text was updated successfully, but these errors were encountered: