Forum


Replies: 12   Views: 3963
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 binukoshy  · 27-04-2011 - 14:44

Dear Team,

While Adding an Image using the function addHTML() , its not inserting image inside a table.

eg: addHTML("<table><tr><td><img src="image.png" /></td></tr></table>");

above code is not inserting the image inside table cell. We require to insert images inside tables ,seems like a bug in phpdocx ,any help is well appreciated.

Thanks in advance

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

Hello,

You can use addMHT method to do this feature. An MHT can add images, HTML, other documents...
Please check:

http://www.phpdocx.com/documentation/add_mht_file

Regards.

Posted by jadeglobal  · 11-04-2013 - 12:12

Its been almost 6 months. Any update to this?

Posted by nicolas  · 11-04-2013 - 12:12

Dear PHPDOCX team,

Could you tell us when the new release including this function will be released ?
The wait is very long... :(

Posted by sysadmin@duoconsulting.com  · 11-04-2013 - 12:12

It's not just tables. We have a similar issue and sent a support ticket in over a month ago and are still waiting for help.

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

Hello,

The new version is working ok, allowing images, HTML and other content to be included in the same document.

Regards.

Posted by inyu4mat  · 11-04-2013 - 12:12

is it working ? bcoz i tried on your website demo.. It's not working at all... cross sign come instead of images which are in html code ..

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

Hello,

The path of the images need to be absolute, like http://www.domain.com/image.png. We're working on a new version to download images and add them to the document.

Regards.

Posted by nicolas  · 11-04-2013 - 12:12

I really need to use an uploaded image in a HTML part of the word document.
Do you have a SVN version of phpdocx because I wait this feature from more than 6 months and no new release :(

Best regards

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.

Posted by guillemt  · 11-03-2014 - 22:46

It's really urgent.


Posted by jorgelj  · 12-03-2014 - 09:18

Hello,



This post is 3 year old. The lastest versions of PHPDocX includes methods to include and replace placeholders with HTML: replaceTemplateVariableByHTML, addHTML, embedHTML...



Please check them.



Regards.