Merge PPTM Files in PHP
Combine PPTM presentations with Aspose.Slides for PHP via Java without requiring Microsoft PowerPoint.
Merge PPTM in PHP
Aspose.Slides for PHP via Java can combine multiple PPTM presentations into one file. The API clones slides from each source presentation into a destination presentation while retaining their content and formatting.
Merge PPTM files using PHP
To merge PPTM presentations, load both files, clone each source slide into the destination presentation, and save the result in PPTM format.
PHP code for merging multiple PPTM files
$destinationPresentation = new Presentation("document1.pptm");
$sourcePresentation = new Presentation("document2.pptm");
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.pptm", SaveFormat::Pptm);
} finally {
$sourcePresentation->dispose();
$destinationPresentation->dispose();
}
How to merge PPTM files in PHP
Follow these steps to merge two PPTM files and save the result as PPTM in PHP.
Install Aspose.Slides for PHP via Java. See Installation .
Configure Aspose.Slides in your PHP project.
Load the source and destination PPTM files with the
Presentationclass, then clone each source slide withaddClone.Call
savewith the output file path andSaveFormat::Pptm.