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

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

How to merge POTM using Aspose.Slides for PHP API

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

  4. Save the resulting POTM doc.

Merge PDF Files Online

How to Merge PDF in Python

Export POTM To Other Supported Formats

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