Add SVG to Word DOC & Avoid SVG Image to EMF Metafile Conversion using C# .NET

Hi,
We have been using Aspose words for almost a decade by now. What we do is mostly doing mailmerge, replacing merge tags in our word templates with text/image content.

Recently we started generating some SVG content and tried to insert them in word templates, which we succeeded.

The problem is the only way i have found for doing so is via DocumentBuilder.InsertImage(svgpath).
It inserts the SVG in the doc but as an image, not a graphic object. Plus fonts look distorted and font weight is missing.
If I insert the same file into documents directly, using MS word’s insert image, it will work absolutely fine.
Am I doing something wrong? Or Aspose words cannot support SVG better than this?

I am attaching a sample docx and the SVG file we used. The first image in the DOCX file is the SVG added using Aspose.Words and the second one is exactly the same file added using MS Word’s “insert image”.

Sample.zip (61.4 KB)

And the SVG file is :

Regards,

Abbas

1 Like

@abbasnaderi Currently Aspose.Words converts SVG images to EMF metafile while inserting into the document (to preserve vector representation for further processing). There is feature request regarding inserting SVG the same way as MS Word does (WORDSNET-21102). This feature is most likely will be added into the next (20.12) version of Aspose.Words. We will let you know once it is available.

The issues you have found earlier have been fixed in this Aspose.Words for .NET 20.12 update and this Aspose.Words for Java 20.12 update.

1 Like

A post was split to a new topic: Insert SVG Image in Word Document & Convert to PDF using C# .NET