Merge POTX Files in PHP

Combine POTX presentations with Aspose.Slides for PHP via Java.

Merge POTX files using PHP

To merge POTX presentations, load both files, clone each source slide into the destination presentation with addClone, and save the result in POTX format.

PHP code for merging multiple POTX files

$destinationPresentation = new Presentation("document1.potx");
$sourcePresentation = new Presentation("document2.potx");
try {
    $slideCount = java_values($sourcePresentation->getSlides()->size());

    for ($slideIndex = 0; $slideIndex < $slideCount; $slideIndex++) {
        $slide = $sourcePresentation->getSlides()->get_Item($slideIndex);
        $destinationPresentation->getSlides()->addClone($slide);
    }

    $destinationPresentation->save("merged.potx", SaveFormat::Potx);
} finally {
    $sourcePresentation->dispose();
    $destinationPresentation->dispose();
}

Merge POTX in PHP

Aspose.Slides for PHP via Java can combine multiple POTX presentations into one file. The API clones slides from each source presentation into a destination presentation while retaining their content and formatting.

How to merge POTX files in PHP

Follow these steps to merge two POTX files and save the result as POTX in PHP.

  1. Install Aspose.Slides for PHP via Java. See Installation.
  2. Configure Aspose.Slides in your PHP project.
  3. Load the source and destination POTX files with the Presentation class, then clone each source slide with addClone.
  4. Call save with the output file path and SaveFormat::Potx.

Built with Aspose.Slides

Merge POTX Files Online

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

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

Merge POTX with Other Supported Formats

You can also combine POTX with presentations in other supported formats.