Skip to content

Instantly share code, notes, and snippets.

@aspose-com-gists
Last active August 27, 2021 16:24
Show Gist options
  • Save aspose-com-gists/ae230d0365b5266a24fe1631a3542d15 to your computer and use it in GitHub Desktop.
Save aspose-com-gists/ae230d0365b5266a24fe1631a3542d15 to your computer and use it in GitHub Desktop.
Convert PowerPoint to SVG using Java
// Instantiate a Presentation class that represents the presentation file
Presentation pres = new Presentation("presentation.pptx");
try {
// Access each slide
for(ISlide sld:pres.getSlides())
{
// Create a memory stream object
FileOutputStream svgStream = new FileOutputStream(String.format("slide_%d.svg", sld.getSlideNumber()));
// Generate SVG image of slide and save in memory stream
sld.writeAsSvg(svgStream);
// Close stream
svgStream.close();
}
} catch (IOException e) {
} finally {
pres.dispose();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment