Replies: 1   Views: 3430
Embedhtml and images inside tables.
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 Web-Op  · 13-11-2012 - 20:25

I'm trying to use EmbedHTML to take a big chunk of HTML generated by another piece of code and dump it straight into my document.

The structure of the HTML is roughly:

* Two-cell horizontal table
* Cell one contains an image, a few lists, and a few links
* Cell two contains a lot of text and a few lists.

If I try to import it, regardless of the downloadImages setting, and regardless of whether I give it a BaseURL option or pass the full path of the image in its < img > tag, I get all the text fine, but no image, not even a placeholder.

If I import the image with an AddImage command, it works, but then it isn't where I want it in the layout. If I

Even minimalizing the code to this, using a known good image, fails.
$docx->embedHTML("<img src=\"\">");

I am viewing it in either LibreOffice 3.6 (which lays out weird-- table columns 20 inches wide that don't fit on the page well), or the Word Viewer (correct layout) but neither shows pics.

What can I try? Is this something that only works in the real Word?