Skip to content

Instantly share code, notes, and snippets.

@blog-aspose-cloud
Last active June 9, 2022 21:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blog-aspose-cloud/9e659f4e7e897d1bf3fec292bb64f4c0 to your computer and use it in GitHub Desktop.
Save blog-aspose-cloud/9e659f4e7e897d1bf3fec292bb64f4c0 to your computer and use it in GitHub Desktop.
Split PowerPoint Presentations using Java

Split PowerPoint Online


This Gist shares details on how to split PowerPoint slides into separate files using Aspose.Slides Cloud SDK for Java.

The following code snippets show the details on how to load PowerPoint from local drive, call the split operation and save the resultant files in .ZIP archive. For complete details, please visit Split PowerPoint Slides into Separate Files in Java.

Split PPT in Java

Important Links

Home | Product Page | Docs | API Reference | Cloud Dashboard | Code Samples | Source Code | Blog | Free Support | Free Trial

Split PowerPoint Presentations using Java
// for more examples, please visit https://github.com/aspose-slides-cloud/aspose-slides-cloud-java/tree/master/Examples/src/main/java/com/aspose/cloud/examples
try
{
// Get ClientID and ClientSecret from https://dashboard.aspose.cloud/
String clientId = "bbf94a2c-6d7e-4020-b4d2-b9809741374e";
String clientSecret = "1c9379bb7d701c26cc87e741a29987bb";
// create an instance of SlidesApi
SlidesApi slidesApi = new SlidesApi(clientId,clientSecret);
// load file from local system
File f = new File("c://Users/test-unprotected.pptx");
// convert the file to Byte array
byte[] bytes = Files.readAllBytes(f.toPath());
// call the API to split PowerPoint from slide index 2 to 3
// If the range is not provided all slides will be processed.
File responseFile = slidesApi.splitOnline(bytes, SlideExportFormat.PPT, 600, 800, 2, 3, "", "Internal", "");
// print the location where resultant Archive is saved
System.out.println("The resultant ZIP file is saved to " + responseFile.getPath());
// print success message
System.out.println("The operation to Split PowerPoint Slides into separate files sucessfully completed !");
}catch(Exception ex)
{
System.out.println(ex.getStackTrace());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment