This quick tutorial guides on how to convert multiple PPT to one PDF using Java. It shares all the details required to configure the environment, detailed steps to be followed to accomplish the task, and a runnable sample code. You can convert multiple PPT files to PDF using Java by loading all the files one by one and adding each slide to a destination presentation which is finally saved as a PDF.
Steps to Convert Multiple PPT to PDF using Java
- Install Aspose.Slides from the Maven repository to convert multiple PPT files to a PDF
- Create a new presentation and clear its slides collection
- Get the list of all the presentations to be rendered into a PDF
- Iterate through all the presentation files
- Iterate through all the slides in each presentation and add the clone to the target presentation
- Save the resultant presentation as a PDF on the disk
These steps provide crisp information to *mass convert PPT to PDF using Java. Although it directs to create an empty presentation to hold all the slides from the target presentation, you may load an existing presentation and add slides from the rest of the presentations to it. Also note that once each slide is accessed from the source presentations, you may set any of the desired properties before saving it to the destination presentation.
Code to Convert Multiple PPT Files to PDF using Java
This code demonstrates the process to convert multiple PPT to one PDF using Java where the Presentation class is used to create or load a presentation file. Each presentation class object contains a collection of slides that is accessed using the ISlideCollection class that provides the addClone() function. You can set a variety of properties of each slide when it is accessed like making decisions based on the hidden status of the slide, setting the layout slide, accessing notes with the slide for processing, and setting the background to name a few.
This presentation has taught us to merge multiple presentations into a single PDF. If you want to learn to create XPS from PPTX, take a look at the article on how to convert PPTX to SVG using Java.