-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Footer/Header in PDF #843
Comments
Any news on this? Ended up inserting custom html code with a position: fixed style |
Can you show some example of your code? |
Settings::setPdfRendererName(Settings::PDF_RENDERER_DOMPDF);
Settings::setPdfRendererPath('/vendor/dompdf/dompdf');
$phpWord = new \PhpOffice\PhpWord\PhpWord();
$section = $phpWord->addSection();
$section->addHeader()->addImage('my-image.png');
$section->addTitle("HELLO WORLD!");
$section->addText('Lorem ipsum dolor sit amet, consetetur sadipscing elitr');
$footer = $section->addFooter();
$footer->addText('FOOTER');
$pdfWriter = IOFactory::createWriter($phpWord, 'PDF');
$pdfWriter->save('sample.pdf');
$docxWriter = IOFactory::createWriter($phpWord, 'Word2007');
$docxWriter->save('sample.docx'); The resulting .docx has header and footer but the .pdf has not. Why? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is it possible to render Footer and Header from Word using the PDF writer?
Seems like it skips the parts created with:
$section->createHeader(); $section->createFooter();
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: