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

Free Support Forum - aspose.com

Embedded Excel object cannot be rendered as SVG with latest Aspose.Words

Hi,

In Aspose.Words 22.9.0, the embedded objects in DOCX can be rendered to SVGs in HTML with HtmlSaveOptions.ExportShapesAsSvg = true. However, it stopped working with Aspose.Words 22.12.0, where the objects are converted to PNG.

Code:

var doc = new Document(@".\embedded.docx");
var options = new HtmlSaveOptions() { ExportShapesAsSvg = true };
doc.Save(@".\out.html", options);

I understood some fixes were added to ensure all shapes are converted to SVG (Some charts are converted as PNG even if HtmlSaveOptions.ExportShapesAsSvg is true ). Even if the mentioned shapes in the linked ticket were fixed, some existing shapes that already worked with SVG are now not working anymore.

I’ve attached the test file and the outputs from both versions for your reference. Could you please help to take a look?

test.zip (30.2 KB)

Thanks,

@ServerSide527 You should specify HtmlSaveOptions.MetafileFormat to HtmlMetafileFormat.Svg. Please see the following code:

Document doc = new Document(@"C:\Temp\in.docx");
HtmlSaveOptions options = new HtmlSaveOptions() { ExportShapesAsSvg = true, MetafileFormat = HtmlMetafileFormat.Svg };
doc.Save(@"C:\Temp\out.html", options);

Hi @alexey.noskov

Thanks for the quick reply. I have tried the parameter and it works indeed.

1 Like