Forum


Replies: 6   Views: 4291
Add image as first element in 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  · 08-08-2014 - 11:17

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.