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.
Hello,
The solution is to remove clean the template before use it. As Words always add a paragraph and doesn't allow to remove it and phpdocx preserves the initial content, you have two options:
· Extract the content of the DOCX, edit the document.xml file, remove the unwanted paragraph manually and save it again as DOCX. A DOCX is a ZIP file, so you can do it with any ZIP app
· Add in this first paragraph a placeholder and remove it using the removeTemplateVariable method before doing anything with the library.
We'll study if it's interesting to add an option in the library to remove that unwanted first paragraph for empty templates. The included template DOCX has it removed.
Regards.