Merge PPSX Files in PHP

Combine PPSX presentations with Aspose.Slides for PHP via Java without requiring Microsoft PowerPoint.

Merge PPSX in PHP

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

Merge PPSX files using PHP

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

PHP code for merging multiple PPSX files

$destinationPresentation = new Presentation("document1.ppsx");
$sourcePresentation = new Presentation("document2.ppsx");
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.ppsx", SaveFormat::Ppsx);
} finally {
    $sourcePresentation->dispose();
    $destinationPresentation->dispose();
}

How to merge PPSX files in PHP

Follow these steps to merge two PPSX files and save the result as PPSX 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 PPSX files with the Presentation class, then clone each source slide with addClone.

  4. Call save with the output file path and SaveFormat::Ppsx.

Merge PPSX with Other Supported Formats

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