Replies: 6   Views: 4568
How to embed image linked in html?
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 honzakuchar  · 11-07-2011 - 16:57

I need to embed image from HTML. I tried following:
- <img src="data:image/png;base64encodedImage" does now working :-(
- <img src="link to local disk" (it links file does not embed it)
- Then I tried MHT file format (MIME format, where is HTML + files + file list). It worked, but word alert that, document is broken. When I click repair, It worked.

Is it possible to [b]embed[/b] image that is simply linked in HTML?

Jan Kuchař

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

I would love to know the answer to this as well.


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


Using the current version of phpdocx, the path of the images must be absolute, like


Posted by aladdin  · 02-10-2013 - 13:19


Using the current version of phpdocx, the path of the images must be absolute, like


Yes, that technic works if you only want to show remote image in your word document when you have access to Internet. But how to EMBED a remote image like to document? Its very important, when creating a document with single addHTML() call.

Posted by elyazalee  · 02-10-2013 - 13:23



When I use replaceTemplateVariableByHTML('contenu','block', $html); with $html content a "<img src='http://domaine.ext/picture.jpg'> 

=> don't work...


Posted by jorgelj  · 03-10-2013 - 09:03


Please check included documentation and phpdoc. There's an option, downloadImages, that you must set to true to download the images.