Merge PPSX Files in Java

Merge PPSX documents using Aspose.Slides for Java server-side APIs.

Merge PPSX Files Using Java

Use Aspose.Slides for Java to load multiple PPSX presentations, clone slides from one presentation into another, and save the merged file. You can install the aspose-slides package in a Maven-based project by adding the repository and dependency below.

Repository

<repository>
    <id>AsposeJavaAPI</id>
    <name>Aspose Java API</name>
    <url>https://releases.aspose.com/java/repo/</url>
</repository>

Dependency

<dependency>
    <groupId>com.aspose</groupId>
    <artifactId>aspose-slides</artifactId>
    <version>26.8</version>
    <classifier>jdk16</classifier>
</dependency>

Merge PPSX Files - Java

Presentation destinationPresentation = new Presentation("presentation1.ppsx");
try {
    Presentation sourcePresentation = new Presentation("presentation2.ppsx");
    try {
        for (ISlide slide : sourcePresentation.getSlides()) {
            destinationPresentation.getSlides().addClone(slide);
        }
    } finally {
        sourcePresentation.dispose();
    }

    destinationPresentation.save("merged-presentation.ppsx", SaveFormat.Ppsx);
} finally {
    destinationPresentation.dispose();
}

Steps for Merging PPSX Files in Java

A basic document merge with Aspose.Slides for Java APIs can be done with just a few lines of code.

  1. Load the destination PPSX file with the Presentation class.
  2. Load the source PPSX file with the Presentation class.
  3. Loop through the ISlide objects in the source presentation.
  4. Call addClone to add each source slide to the destination presentation.
  5. Call the save method with SaveFormat.Ppsx.

System Requirements

Before running the Java merge sample code, make sure that you have the following prerequisites.

  • Microsoft Windows, Linux, macOS, or another OS with a supported Java Runtime Environment.
  • Get the latest version of Aspose.Slides for Java from Maven.

Built with Aspose.Slides

Merge PPSX Files Online

The free Aspose.Slides Merger app is built with Aspose.Slides for Java, the same API as the code above. Open it and see what the API can do with your own PPSX files.

  • Runs in your browser, nothing to install.
  • See how Aspose.Slides merges files before you write code.
  • Upload several PPSX files and combine them into one.
  • Download the merged result as one file.

What is PPSX File Format?

Files with the .PPSX extension are PowerPoint Slide Show files created with Microsoft PowerPoint 2007 or later. A PPSX file opens directly as a slide show while preserving the presentation content.

Read More