Merge PPTX files together in PHP

High-speed and cross-platform PHP API that helps in developing applications with the ability to create, merge, inspect, or convert Microsoft PowerPoint and OpenOffice presentation files without the use of any software like Microsoft or Open Office, Adobe PDF.

Merge PPTX in PHP

Aspose.Slides for PHP via Java is a powerful PHP library for creating and manipulating presentation files. Moreover, it provides flexible ways to combine multiple PPTX presentations. When you merge one presentation to another, you are effectively combining their slides in a single presentation to obtain one file. Aspose.Slides allows you merge two presentations in different ways. You get to merge presentations with all their shapes, styles, texts, formatting, comments, animations, etc. without having to worry about loss of quality or data.

Merge PPTX files using PHP

To merge the PowerPoint presentations, you will need to clone the slides from one presentation to the other.

PHP code for merge multiple PPTX into single file


<?php
require_once("http://localhost:8080/JavaBridge/java/Java.inc");
require_once("lib/aspose.slides.php");
 
use aspose\slides\Presentation;
use aspose\slides\SaveFormat;
 
$pres1 = new Presentation("document1.pptx");
$pres2 = new Presentation("document2.pptx");
try
{
    for ($i = 0; $i < java_values($pres2->getSlides()->size()); $i++) 
    {
        $pres1->getSlides()->addClone($pres2->getSlides()->get_Item($i));
    }

    $pres1->save("merged.pptx", SaveFormat::Pptx);
}
finally
{
    if ($pres1 != null) $pres1->dispose();
    if ($pres2 != null) $pres2->dispose();
}
?>

How to merge PPTX using Aspose.Slides for PHP API

These are the steps to merge two PPTX files and save result as PPTX in PHP.

  1. Install Aspose.Slides for PHP via Java. See Installation .

  2. Add the library as a reference in your project.

  3. Load the PPTX files you want to merge.

  4. Save the resulting PPTX doc.

Merge PDF Files Online

How to Merge PDF in Python

Export PPTX To Other Supported Formats

You can also combine PPTX and save to other file formats. See all supported formats below