-
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
TemplateProcessor insert PageBreak possible? #1082
Comments
Can you try the following? in you word document, put
Then run: Settings::setOutputEscapingEnabled(false); //important, otherwise the XML will be written as is in the word document
$templateProcessor = new \PhpOffice\PhpWord\TemplateProcessor('resources/template.docx');
$templateProcessor->setValue('pageBreakHere', '<w:p><w:r><w:br w:type="page"/></w:r></w:p>');
$templateProcessor->saveAs('results/generated_templateFile.docx'); |
This is not working for me. Can anyone confirm that it is working? |
@SalvatorePollaci this worked for me. |
It's only working when opening on Word, not LibreOffice... |
I've found your solution working also on OpenOffice. First you need to close previous text tag and reopen new row in the same paragraph with page break: |
Not worked for me please can you share with more detail getting error with [ Settings::setOutputEscapingEnabled(false); ] this line |
Thank you very much! |
Hi
ist it possible to insert a pagebreak inside a processed document?
thanks!
Alex
The text was updated successfully, but these errors were encountered: