Replies: 3   Views: 3067
Embedding external images 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 davelavinsky  · 07-05-2018 - 10:30

Why doesn't embedding external images in HTML work ?

$html .= "<img src=''/>";

Using phpdocx-corporate-5.5

Posted by admin  · 07-05-2018 - 11:37


We have tested it and the image is added correctly. Maybe you need to set downloadImages as true; we recommend you to read the documentation available on:

As you are using phpdocx 5.5, the stream mode is not available. This stream mode is only available since phpdocx 7.5 and newer.


Posted by davelavinsky  · 07-05-2018 - 11:57

$docx = new CreateDocx();
$text = 'Testing 123';
$img_src = ",40&cht=p3&chl=Hello|World";
$html = "<img src='{$img_src}'/>";

I get Read Error.

Posted by admin  · 07-05-2018 - 12:10


You are trying to add a not static image (a file) as phpdocx 7 and previous versions of phpdocx need. You need to download the image and then insert it or use the stream mode available in phpdocx 7.5 and newer.