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