Forum


Replies: 3   Views: 297
Insert svg file 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 admin  · 06-01-2025 - 10:57

Hello,

Please note that you can find samples using all the features of phpdocx on the API pages. For example, on  the img tag documentation page: https://www.phpdocx.com/htmlapi-documentation/html-standard/insert-image-Word-document-with-HTML

The following simple sample adds an SVG image transforming HTML:

$html = '<img src="https://dev.w3.org/SVG/tools/svgweb/samples/svg-files/mt.svg">';
$docx->embedHTML($html);

You can also use base64 content (all licenses) or an svg tag (with a Premium license).

As explained in our previous reply, PHP ImageMagick must be installed and enabled to add SVG content.

Regards.