-
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
Html(twig) to docx #1181
Comments
Could you explain better what you want to accomplish? $phpWord = \PhpOffice\PhpWord\IOFactory::load($wellformed_html_filename, 'HTML');
$objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'Word2007');
$objWriter->save();
$templateProcessor = new \PhpOffice\PhpWord\TemplateProcessor($new_docx_filename);
$templateProcessor->*(); You need to You can use the mustache variables in the TemplateProcessor if you want (but you need to disable the automatic addition of See: |
Hey @FBnil , Thanks for your quick answer. This is my code actually : `public function convertToWordAction(Request $request) {
Actually, i got a problem on the addHtml, who return this error : Warning: DOMDocument::loadXML(): Start tag expected, '<' not found in Entity, line: 1 What did i missed ? Thanks for your help ! |
Use renderView instead of render function, because render also returns response headers. |
Hi, when be convert html to docx dont does a page break when the html content is long. ¿There are a solution for this? |
Hello, It works for me with renderView but don't consider the CSS. How can I do to put CSS ? |
@AdonisGC I use renderView,display “DOMDocument::loadXML(): Specification mandates value for attribute hidden in Entity, line: 1”。help me。 |
Hi everyone,
I'm using PHPWord in my SF2.8 application, and i would like to use a twig as template for my docx.
Does anybody did that ?
Thanks a lot !
The text was updated successfully, but these errors were encountered: