This gist explains the steps and code snippet on how to convert PPT / PPTX (PowerPoint) presentations to raster image formats such as JPG and PNG using Aspose.Slides Cloud SDK for Java.
For more information, please visit
This gist explains the steps and code snippet on how to convert PPT / PPTX (PowerPoint) presentations to raster image formats such as JPG and PNG using Aspose.Slides Cloud SDK for Java.
For more information, please visit
This Gist contains code snippets related to conversion of PPT and PPTX formats to JPG, PNG (raster image) formats. |
// Get ClientID and ClientSecret from https://dashboard.aspose.cloud/ | |
String clientId = "718e4235-8866-4ebe-bff4-f5a14a4b6466"; | |
String clientSecret = "388e864b819d8b067a8b1cb625a2ea8e"; | |
// create an instance of SlidesApi | |
SlidesApi slidesApi = new SlidesApi(clientId,clientSecret); | |
// load file from local system | |
File f = new File("/Users/nayyershahbaz/Documents/input.ppt"); | |
// convert the file to Byte array | |
byte[] bytes = Files.readAllBytes(f.toPath()); | |
// create instance of PutSlideSaveAsRequest | |
PutExportSlideRequest request = new PutExportSlideRequest(); | |
// format of output file | |
request.setFormat(SlideExportFormat.PNG); | |
// name of input PPT available on Cloud Storage | |
request.setDocument(bytes); | |
// set slide index | |
request.setSlideIndex(1); | |
// name of resultant file | |
request.setOutPath("Converted.png"); | |
// call the API method to perform PPT to PNG conversion | |
slidesApi.putExportSlide(request); |
// Get ClientID and ClientSecret from https://dashboard.aspose.cloud/ | |
String clientId = "718e4235-8866-4ebe-bff4-f5a14a4b6466"; | |
String clientSecret = "388e864b819d8b067a8b1cb625a2ea8e"; | |
// create an instance of SlidesApi | |
SlidesApi slidesApi = new SlidesApi(clientId,clientSecret); | |
// create instance of PutSlideSaveAsRequest | |
PutSlideSaveAsRequest request = new PutSlideSaveAsRequest(); | |
// format of output file | |
request.setFormat(SlideExportFormat.JPEG); | |
// name of input PPTX available on Cloud Storage | |
request.setName("Presentation1.pptx"); | |
// name of resultant file | |
request.setOutPath("Converted.jpeg"); | |
// index of slide to be converted | |
request.setSlideIndex(1); | |
// call the API method to perform PPTX to JPG conversion | |
slidesApi.putSlideSaveAs(request); |