In this tutorial, we will focus on how to convert PDF to Presentation using Java in MS Windows, macOS, or Ubuntu operating systems. The topic covers the detailed steps to set up the environment and by using a few lines of easy code in Java add PDF to presentation with no dependence on MS PowerPoint.
Steps to Import PDF in PowerPoint using Java
- Configure your application project to install Aspose.Slides for Java from the Maven repository
- Create an empty presentation using the Presentation class to add PDF to PPTX in Java
- Load the source PDF file from the disk and add to presentation slides collection using addFromPdf method
- Save method in Java convert PDF to presentation
The above steps are followed to insert PDF to presentation using Java where the process is started by creating a default empty presentation using the Presentation class instance. By using SlideCollection.addFromPdf method, insert the PDF in slides by loading the source PDF file path and finally save the generated presentation on the disk using the save method.
Code to Add PDF to PowerPoint using Java
The above example can also add PDF to PPT using Java where you will have to choose SaveFormat.Ppt enumerator inside the save method. The addFromPdf method also allows to add the PDF using memory stream and a new slide will be created inside the presentation for every page inside the PDF. One can load and add multiple PDF files inside the presentation.
In this topic, we have explored that in order to add PDF to presentation Java based API can be efficiently used by using the simple API calls. If you are interested in converting the presentation to PDF, refer to the article on how to convert PPT to PDF using Java.