PNG JPG BMP TIFF POTX
Aspose.Slides  for Java
POTX

Merge POTX Files in Java

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

Merge POTX Files Using Java

Use Aspose.Slides for Java to load multiple POTX 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>version of aspose-slides API</version>
    <classifier>jdk17</classifier>
</dependency>

Steps for Merging POTX 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 POTX file with the Presentation class.

  2. Load the source POTX 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.Potx.

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.
 

Merge POTX Files - Java

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

    destinationPresentation.save("merged-presentation.potx", SaveFormat.Potx);
} finally {
    destinationPresentation.dispose();
}
 
  • Merge POTX Files Online

    Merge presentations and slides online.

    About Aspose.Slides for Java API

    Aspose.Slides for Java can read, write, manipulate, merge, and convert Microsoft PowerPoint and OpenDocument presentations to formats such as PDF, XPS, HTML, TIFF, and ODP. It is a standalone API and does not require Microsoft PowerPoint or OpenOffice.

    Online POTX Merger Live Demos

    Other Supported Merging Formats

    Using Java, you can also merge many other file formats including the ones listed below.

    ODP (OpenDocument Presentation Format)
    OTP (OpenDocument Standard Format)
    POT (Microsoft PowerPoint Template Files)
    POTM (Microsoft PowerPoint Template File)
    PPS (PowerPoint Slide Show)
    PPSM (Macro-enabled Slide Show)
    PPSX (PowerPoint Slide Show)
    PPT (Microsoft PowerPoint 97-2003)
    PPTM (Macro-enabled Presentation File)
    PPTX (Open XML presentation Format)