This tutorial provides you with details on how to convert PPTX to PPT in Java. You will get the information about the development environment configuration, programming steps, and a runnable sample code to change PPTX to PPT in Java. The sample code not only demonstrates the basic process required for the conversion but also shares tips to modify the loaded PPTX presentation before saving it back as a PPT file.
Steps to Convert PPTX into PPT in Java
- Set your development environment to add Aspose.Slides library from the repository
- Load the template PPTX file into the Presentation class object
- Perform some operations on the loaded presentation like deleting a slide
- Set the view type
- Save the modified presentation as PPT converted from PPTX
These steps describe the process to transform PPTX into PPT in Java where first we have to load the template PPTX file into a Presentation class object and then can save it directly as a PPT file. However, for your understanding, a few extra steps are performed that are optional and can be skipped like we have modified the loaded presentation by deleting its second slide and we also set the view type for the output presentation. Similarly, we can customize the output PPTX file using the different overloaded functions for the save method.
Code to Convert PPTX to PPT in java
This code demonstrates how to write a PPTX to PPT file converter in Java where you can customize this operation by using the LoadOptions class object while loading the template PPTX file like setting the password for secure presentations, interruption token to cancel the loading in case of any abnormal situation, the default font in case of a missing font, and setting preferred culture. On the other hand, we have the option to customize the output PPT file by using the PptOptions class object in the save() method that provides a number of properties that can be set.
In this tutorial, we have learned to convert PPTX to PPT in Java. If you want to learn other types of conversions like PPTX to SVG, refer to the article on how to convert PPTX to SVG using Java.