Forum


Replies: 2   Views: 1526
Crash when using a custom docx file as base template
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by admin  · 06-07-2020 - 10:54

Hello,

To use a DOCX as template, you need to use CreateDocxFromTemplate, not CreateDocx (https://www.phpdocx.com/documentation/practical/working-with-templates). Please send the DOCX you are using as template to contact[at]phpdocx so we can test it, phpdocx is tested from MS 2003 to MS Word 2019 (including MS Word 365 and online versions), LibreOffice and other DOCX editors. The line that returns the error you have sent is trying to get the main file of a DOCX ([Content_Types].xml) that should always exist.

Adding @ may be helpful only to hide some unwanted PHP notice, not warnings or errors.

Also note that using an Advanced you can't use HTML Extended. This feature is only available in Premium licenses, so you can't use the following option:

'useHTMLExtended'  => true,

Regards.