Forum


Replies: 12   Views: 3819
Image & html not working together
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 llouis  · 11-04-2013 - 12:12

I noticed a problem when I try to add HTML WITH css (addBasicHTML) and an image. Word says the document is corrupted. After unzipping it, I noticed that the rID index are corrupted.
If CSS is applied, the rID index is reset in the file document.xml.rels. Then There's two occurence of rID1.
After a look in the code, I understood the rID index is built with a static variable of the class createDocx. Then this variable is shared between all instances of createDocx. Unfortunatelly when you add HTML with CSS, the code uses the class HTML2DOCX that instanciate another createDocx (in fonctions HTML2DOCX::generateXML and HTML2DOCX::generateDOCX), . Then the rID index is reset and the produced document contains corrupted rID.