We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

SVG renders incorrectly in output DOCX and PDF using .NET

Hi,

I am currently evaluating Aspose.Words and see if it meets my requirements.

I encountered some rendering issues with including SVG files in a word document. I attached a rather simple svg file which renders some text.
If you view the svg in a browser, it looks as I expect. If you drag&drop it into an open Word document, it also looks as expected. If I insert this SVG file with Aspose.Words, using the Aspose.Words.DocumentBuilder.InsertImage(string filename) method, the result looks different. Specifically, it seems
• that some whitespace is eliminated,
• that a baseline-shift is not working
• and that font-weight is not working.

I think you should be able to reproduce this issue easily using the attached svg (zipped). Since I make heavy use of svg images, this is a crucial feature for me.
simple.zip (465 Bytes)

I also have two additional questions regarding the conversion to pdf.

  1. I added an image (png) to the header of a sample word document and inserted page breaks, so the document had 20 pages in the end. I then converted this docx file to a pdf and compared it with a pdf was generated from the same docx but with only 2 pages. The pdf with 20 pages was a little bigger than the one with 2 pages, but it was not 20 times the size of the png image bigger. I assume, you are deduplicating identical images, which is great, as I strive to create pdf documents as small as possible.
  2. Are you inserting the svg as a vector in pdf or is this converted to a raster image when exported to PDF?

Thanks for your feedback.

Best,
Florian

@fordi

We have tested the scenario and have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET-20002. You will be notified via this forum thread once this issue is resolved. We apologize for your inconvenience.

Please ZIP and attach your documents, images and expected output along with simple code example to reproduce this issue at our end. We will investigate the issue and provide you more information on it.

We are working over your query and will get back to you soon.

@fordi

When SVG is inserted into the document, it is converted to EMF meta file (that is vector image). It is rendered as vector graphics when save to PDF.

The issues you have found earlier (filed as WORDSNET-20002) have been fixed in this Aspose.Words for .NET 20.6 update and this Aspose.Words for Java 20.6 update.