Merge OTP Files in PHP
Combine OTP presentations with Aspose.Slides for PHP via Java.
Merge OTP files using PHP
To merge OTP presentations, load both files, clone each source slide into the destination presentation with addClone, and save the result in OTP format.
PHP code for merging multiple OTP files
$destinationPresentation = new Presentation("document1.otp");
$sourcePresentation = new Presentation("document2.otp");
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.otp", SaveFormat::Otp);
} finally {
$sourcePresentation->dispose();
$destinationPresentation->dispose();
}Merge OTP in PHP
Aspose.Slides for PHP via Java can combine multiple OTP presentations into one file. The API clones slides from each source presentation into a destination presentation while retaining their content and formatting.
How to merge OTP files in PHP
Follow these steps to merge two OTP files and save the result as OTP in PHP.
- Install Aspose.Slides for PHP via Java. See Installation.
- Configure Aspose.Slides in your PHP project.
- Load the source and destination OTP files with the
Presentationclass, then clone each source slide withaddClone. - Call
savewith the output file path andSaveFormat::Otp.
Built with Aspose.Slides
Merge OTP Files Online
The free Aspose.Slides Merger app is built with Aspose.Slides for PHP via Java, the same API as the code above. Open it and see what the API can do with your own OTP files.
- Runs in your browser, nothing to install.
- See how Aspose.Slides merges files before you write code.
- Upload several OTP files and combine them into one.
- Download the merged result as one file.
Merge OTP with Other Supported Formats
You can also combine OTP with presentations in other supported formats.