Merge POTX 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 POTX 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 POTX 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 POTX 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 POTX 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.potx");
$pres2 = new Presentation("document2.potx");
try
{
    for ($i = 0; $i < java_values($pres2->getSlides()->size()); $i++) 
    {
        $pres1->getSlides()->addClone($pres2->getSlides()->get_Item($i));
    }

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

How to merge POTX using Aspose.Slides for PHP API

These are the steps to merge two POTX files and save result as POTX 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 POTX files you want to merge.

  4. Save the resulting POTX doc.

Merge PDF Files Online

How to Merge PDF in Python

Export POTX To Other Supported Formats

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