Forum


Replies: 2   Views: 2998
Word output corruption :why
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 smaubian  · 18-11-2011 - 10:21

Good morning,

I'm working on a template integration. I'm not responsible of the template, i have a team in charge of building templates that provide them to me and i just need to do the integration part.

Very often when i receive their template is is not working with phpdocx. the document is generated but when i open it in word, Word says "there is an error in the document" and then open it but updating items (and i don't always know what it does).

I found that cleaning up the file in word2k7 "Office"=>"Prepare"=>"Inspect Document" is fixing the issues in most cases.

I'm wondering why this is happening. Before getting through phpdocx the template works find. When adding the template to a phpdocx document and replacing variables, in some cases phpdocx "corrupt" the result.

I think of 2 possibilities :

1- The phpdocx parser is missing some configurations
2- The Word opendocument implementation is crap


Are you aware of those issues with corrupted documents and are you updating your solution to better support the DOCX output ?

Posted by admin  · 11-04-2013 - 12:13

Hello,

After changing a word, not clearing but removing a part of it and writting a new one, Word adds some unwanted tags. Phpdocx should clean them, but maybe it's failing.

Please open a template and on document.xml look for the placeholder. If it has tags (like $V<tag></tag>AR$) just remove them before running phpdocx.

Regards. Jorge.