Forum


Replies: 2   Views: 411
Img tag support in phpdocx 7.5
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 Hospitify  · 17-02-2023 - 19:59

We have Phpdocx Version 7.5. 

We have some img tags that work when echoing the html to the browser. The images are hosted on the same site as our phpDocx directory.

But when we use $docx->embedHTML($html);  - the images are broken. 

Is that a known issue in V 7.5 ? 

If not, any hints on how to solve the broken tags? 

 

Posted by admin  · 17-02-2023 - 20:48

Hello,

There's no known issue in phpdocx 7.5 working with HTML images using the supported image formats and options.

Maybe you are not adding the images correctly. Please note that since phpdocx 8.5, the downloadImages option available in embedHTML (https://www.phpdocx.com/api-documentation/word-content/embed-html-Word-document-with-PHP) is true as default, but in previous versions this option is false as default. Maybe you need to enable this option or the images you are adding can't be readed/get by PHP.

On Insert images with HTML you can read more information about adding images with HTML. Please note that some features detailed on this page are only available in the latest versions of phpdocx. In the package you can find samples of all methods for the version you are using.

We recommend you upgrade to the latest version of phpdocx to be able to use all features included since phpdocx 7.5: https://www.phpdocx.com/news/

Regards.

Posted by Hospitify  · 17-02-2023 - 23:27

It's working now. Thanks for all your hints.