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

Free Support Forum - aspose.com

Invalid SVG formed when converting a slide containing an image to SVG format

Hello,


I am using Aspose.slides v16.1.0 to convert a slide to SVG and HTML format.

When the slide contains an image, the SVG output of that slide is invalid. I validated the SVG using an XML editor and the SVG was invalid.

Sample code for converting slide to Svg:
Presentation presentation = new Presentation(“presentation.pptx”);
ISlide slide = presentation.getSlides().get_Item(0);
File outputFile = new File(“slide to svg output.svg”);
OutputStream outputStream = new FileOutputStream(outputFile);
slide.writeAsSvg(outputStream);

I converted the slide to HTML format too. Both the SVG and HTML output are opened up fine in the Browser.

Sample code for converting slide to Html:
Presentation presentation = new Presentation(“presentation.pptx”);
HtmlOptions htmlOptions = new HtmlOptions();
presentation.save(“slide to html output.html”,new int[] {1}, SaveFormat.Html, htmlOptions);

But I tried to convert the HTML generated by Aspose.slides to PNG format using Aspose.words and the PNG generated is incorrect. There is no content in the PNG output, except only white background. I have logged an issue for this on Aspose.words forum too.

Sample code for converting html to png using Aspose.words:
Document doc = getDocument(“slide to html output.html”);
ImageSaveOptions options = new ImageSaveOptions(SaveFormat.PNG);
options.setPageIndex(1);
doc.save(“html to png output.png”, options);

I also tired to convert the SVG generated by Aspose.slides to PNG using an external tool, and it is also rendering an incorrect PNG (no content, only white background).

This issue occurs only when the slide contains an image.

For your reference, I have attached the PPT, its Html & Svg output generated using Aspose.slides and the PNG generated from the HTML output using Aspose.words.

Can you please look into this issue.

Thanks,
Neha
Hi Neha,

Thank you for posting.

I have observed your comments and like to share with you that I am able to reproduce the issue on my end. A ticket with ID SLIDESJAVA-35394 has been logged in our issue tracking system to further investigate and resolve the issue.This thread has been linked with the issue so that you may be notified automatically as soon as the issue will be resolved.

We are sorry for your inconvenience,
Hi Neha,

We have investigated the issue reported by you and like to request you to please share following details with us:

Which tool are you using on your end to validate the svg and html? Which tool to convert svg to png and which version of Aspose.Words are using for converting html to png.

Please share the requested details so that we may proceed further to help you out.

Best Regards,

Hello,


I am using Aspose.words v 16.2.0 for converting html to png.
For validating the svg, I used XML Spy.
And for converting svg to png, I used ImageMagick - v6.9.3.5 and v7.0.0

Thanks,
Neha

Hi Neha,


I have updated the information in our issue management system. We will get back to you, if necessary, or we will notify you once the issue will be resolved

Best Regards,