Merging Multiple PPTs using java
To merge multiple PowerPoint Presentation files using Java. To achieve this use a Java Library called Apache POI. Apache POI is a project run by the Apache Software Foundation, and previously a sub-project of the Jakarta Project, provides pure Java libraries for reading and writing files in Microsoft Office formats, such as Word, PowerPoint and Excel. Use Apache guide to install the Apache POI libraries for Windows/Linux Systems.
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course.
Input : file1.pptx, file2.pptx Output: merged.pptx Input : file1.pptx file2.pptx file3.pptx Output: merged.pptx
- Get the current working directory path and list all the presentation files
- Create an empty Presentation Object using XMLSlideShow from apache POI package
- Iterate through each Presentation File from the list and append slides to the empty Presentation Object
- Save the new merged Presentation File
Below is the implementation of the above approach: