Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TOC Footer #96

Closed
xenoborg007 opened this issue Mar 7, 2016 · 3 comments
Closed

TOC Footer #96

xenoborg007 opened this issue Mar 7, 2016 · 3 comments

Comments

@xenoborg007
Copy link

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');

@josh18
Copy link

josh18 commented Jul 7, 2016

Did you ever find a way around this?

@codemzy
Copy link

codemzy commented Oct 19, 2016

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.

@finwe
Copy link
Member

finwe commented May 23, 2021

Closing as stale.

If appropriate, feel free to create a new discussion/issue for the last mPDF version according to current contribution guidelines.

@finwe finwe closed this as completed May 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants