Split PowerPoint Document into Individual Slides in Java

This article demonstrates how to split a PowerPoint document into multiple individual slides using Spire.Presentation for Java.

import com.spire.presentation.FileFormat;
import com.spire.presentation.Presentation;

public class SplitPowerPoint {

    public static void main(String[] args) throws Exception {

        //Load the sample PowerPoint file
        Presentation ppt = new Presentation();

        //Loop through the slides
        for (int i = 0; i < ppt.getSlides().getCount(); i++)
            //Create an instance of Presentation class
            Presentation newppt = new Presentation();

            //Remove the default slide

            //Select a slide from the source file and append it to the new document

            //Save to file
            newppt.saveToFile(String.format("output/result-%d.pptx",i), FileFormat.PPTX_2013);


Split PowerPoint Document into Individual Slides in Java