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

Headers and Footers in document generated from HTML #1105

Closed
pankamilr opened this issue Jul 21, 2017 · 5 comments
Closed

Headers and Footers in document generated from HTML #1105

pankamilr opened this issue Jul 21, 2017 · 5 comments

Comments

@pankamilr
Copy link

pankamilr commented Jul 21, 2017

I try to generate .docx file from HTML and by now it generates good. But I want to add footer to the document and I think that HTML writer doesn't include addFooter method. How I supposed to add footer to HTML generated document?

@troosan
Copy link
Contributor

troosan commented Jul 21, 2017

@pankamilr Header & Footer are only applicable when printing pages, which is not the case for HTML. Do you want to a footnote maybe? In that case please check Sample_06_Footnote.php

@pankamilr
Copy link
Author

pankamilr commented Jul 24, 2017

@troosan thanks for your reply. After some research finally I got the fact, that I use previous version of phpWord (0.12) - I participate in the project after someone, that's why. After update to 0.13 there's is method \PhpOffice\PhpWord\Shared\Html::addHtml which can be use to add HTML to docx and add header and footer to the section. So issue is closed.

@troosan
Copy link
Contributor

troosan commented Jul 24, 2017

great!

@harbvxz
Copy link

harbvxz commented Jan 14, 2020

@troosan thanks for your reply. After some research finally I got the fact, that I use previous version of phpWord (0.12) - I participate in the project after someone, that's why. After update to 0.13 there's is method \PhpOffice\PhpWord\Shared\Html::addHtml which can be use to add HTML to docx and add header and footer to the section. So issue is closed.

Hi @pankamilr,

How did you add header and footer?

@arce701
Copy link

arce701 commented May 22, 2023

Html::addHtml($footer, view($footerTemplate), false, false);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants