This simple article focuses on how to convert PPT to PDF using Java by following the detailed configuration steps to use the given code sample. You can use the following example in any of the Java configured environments including MS Windows, Linux or macOS to generate PDF from PPT in Java without any dependency on MS PowerPoint.
Steps to Generate PDF from PPT in Java
- Configure your application to install Aspose.Slides for Java from the Maven repository
- Load the source presentation from the disk using the Presentation class object to convert it to PDF
- Instantiate the PdfOptions class object and set the desired PDF options
- Set the different PDF options using PdfOptions object
- Convert the PPT to PDF using the save method
By following the above steps in Java PPT to PDF converter application is developed where by the process commence by loading the source PPT presentation from the disk using the Presentation class instance. Then, by using PdfOptions class different properties like compliance, JpegQuality and TextCompression are set for the desired PDF and finally by using the save method in Java PPT PDF conversion is done.
Code to Convert PPT to PDF in Java
The above example exhibits that in order to export PPT to PDF Java code using simple API calls can be used. The API also allows to convert the other presentation formats including PPTX, POTX, ODP, PPS, PPSX to PDF using the same example. The PdfOptions class exposes different setter methods to customize the output PDF by using properties like ImageTransparentColor, EmbedFullFonts, DrawSlidesFrame, ShowHiddenSlides and NotesCommentsLayouting.
In this topic we have witnessed that to convert PPT to PDF Java based API with simple API interface can be effectively used in your application with no dependency on PowerPoint. If you are interested in converting the presentation to TIFF images, refer to the article on how to convert PowerPoint to Tiff using Java.