# Merge POTX Files in PHP

> Merge multiple POTX presentations in PHP with Aspose.Slides for PHP via Java.

Source: https://products.aspose.com/slides/php-java/merger/potx/
Updated: 2026-07-20



## Merge POTX in PHP

[**Aspose.Slides for PHP via Java**](/slides/php-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.

## 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

```php
$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();
}
```

## How to merge POTX files in PHP

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

Install **Aspose.Slides for PHP via Java**. See [**Installation**](https://docs.aspose.com/slides/php-java/installation/).

Configure Aspose.Slides in your PHP project.

Load the source and destination POTX files with the `Presentation` class, then clone each source slide with `addClone`.

Call `save` with the output file path and `SaveFormat::Potx`.

## Merge POTX with Other Supported Formats
