Joining multiple presentations into a single one is now just a task of few lines of code. This article discusses different ways how to merge multiple PowerPoint presentations into a single one in Java. Furthermore, it will show how you can merge specific slides of two or more presentations using a similar java source code.
The following topics are covered in this article:
- Presentation Merger Java API
- How to Merge PowerPoint Presentations
- How to Merge Specific Presentation Slides
Java API to Merge Presentations
GroupDocs equips high-code document automation APIs for merging similar and multiple types of documents. It allows the merging and splitting of documents, moving certain pages, removing, swapping, and extracting pages from various documents with just a few lines of code.
This article uses GroupDocs.Merger for Java in the examples. You can download the JAR file from the downloads section or use the latest repository and dependency configurations within your Maven-based Java applications.
<repository>
<id>groupdocs-artifacts-repository</id>
<name>GroupDocs Artifacts Repository</name>
<url>https://releases.groupdocs.com/java/repo/</url>
</repository>
<dependency>
<groupId>com.groupdocs</groupId>
<artifactId>groupdocs-merger</artifactId>
<version>22.7</version>
</dependency>
How to Merge PowerPoint Presentations (PPT/PPTX) in Java
Combining multiple presentations is quite similar to combining just 2 files. The following steps show how to merge PPT or PPTX presentation files within the application using Java.
- Load the first presentation using the Merger class.
- Combine the second presentation using the join method.
- Keep joining more PPT or PPTX files using the same join Method.
- Save the merged presentations file using the save method.
The following Java code snippet merges multiple PowerPoint presentations.
How to Merge Specific Presentation Slides in Java
You can also merge specific slides of multiple presentations. The following steps show how to merge specific presentation slides in Java.
- Load the first presentation using the Merger class.
- Define the slides to join using the JoinOptions class.
- Now, combine both presentations using the join method with prepared join options.
- Save the merged presentation file using the save method.
The following Java code snippet combines the selected slides of the presentations.
Free API License
You can get a free license and merge your presentations without evaluation limitations.
Conclusion
In this article, we discussed how to merge two or more PPT files in Java. Precisely we combined whole presentations and then also merged a few selected slides from multiple presentations. You can use this merging feature in your Java applications.
Learn More & Get in Touch
In case you want to know more about the Java Merger API by GroupDocs, visit: Documentation | API reference | GitHub Examples
Contact us on the forum about any queries.