Problem saving Word Document With SVG as PDF...SVG Gradient Gets Lost

Aspose.zip (162.0 KB)

I have a Word document that I’m trying to save as PDF using Aspose but the embedded SVG file is losing its gradient fill.

I have 3 examples of the offending SVG file in the Word document (Source Document.docx). The 3 SVG images look fine in Word and they also look fine when I double click them and view them in Edge, Chrome and Firefox so the image files themselves seem valid.

The first image “Original.svg” is what I started with.

The second image “Original (Formatted by Illustrator).svg”. Is just the original file saved by Illustrator which made a bunch of structural changes that I had hoped would solve the issue.

The third image “Original (Formatted by Illustrator - Black).svg” is the same as the 2nd image saved by Illustrator but instead of the gradient, I used a solid black fill.

As you can see in the result (Converted Document.pdf), the gradient is lost. It does work properly in the 3rd one where I use a solid black fill instead of the gradient though…but, of course, I miss out on the gradient.

I literally am just opening the source Word document and saving it as PDF.

I wonder if there is an issue saving Word documents as PDF where the source files include an SVG file that contains a gradient?

I did find the posting that seemed to refer to the same issue but essentially it said to save the SVG as png or some other rasterized image, but I need it to scale nicely upon zoom so SVG is my desired image format.

I’m hoping someone might have struggled with this same issue and hopefully have some sort of work-around or suggestion of what I might be doing wrong.

Thanks so much in advance for any insight on this!

@toddn Thank you for reporting the problem to us. For a sake of correction it has been logged as WORDSNET-24813. We will keep you posted and let you know once the issue is resolved or we have more information for you.

I think I’ve gotten down to the heart of the issue.

When saving a Word document as a PDF using Aspose, any shape in an embedded SVG that has a:
• Solid color fill…renders properly in the resulting PDF
• Gradient fill…renders properly in the resulting PDF
• Solid color stroke (border)…renders properly in the resulting PDF
• Gradient stroke (border)…THE BORDER IS MISSING

@toddn Thank you for additional information. Our development team made the same conclusion. Currently, SVG import does not support gradients for the stroke attribute. Only solid color is supported.