Forum


Replies: 3   Views: 212
Combining existing files
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phppptx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phppptx version and check the Documentation available.

Posted by jgjloopio  · 23-08-2024 - 14:05

Does the library provide functionality for combining multiple existing pptx files together?

For example, if I have Presentation1.pptx containing a slide, and Presentation2.pptx containing a slide, do any methods support combining these into a single Presentation3.pptx which contains the slides from both Presentation1.pptx and Presentation2.pptx?

Posted by admin  · 23-08-2024 - 18:01

Hello,

A merging class is available in the current testing branch and will be included in the next stable release of phppptx (there's no release date). This new feature is fully tested and working.

If you purchase a license (Advanced or Premium), please send a message to contact[at]phpdocx.com and we'll send you the new class.

A sample merging PPTX files:

require_once 'classes/MergePptx.php';

$pptx = new MergePptx();
$pptx->merge(array('file1.pptx', 'file2.pptx', 'file3.pptx'), 'output_merged.pptx');

There's no limit on the number of PPTX files to be merged.

Regards.

Posted by jgjloopio  · 23-08-2024 - 18:43

That's good to know, thank you.

Could you provide any additional detail on what the output of the merge woud be like? For example, how does the class handle the possiblity that each merging file may have different layouts or themes?

Posted by admin  · 23-08-2024 - 21:16

Hello,

layouts, themes, masters, handouts, sections, and many other content types are supported when merging the PPTX files.

This is the description of the method:

The merging process preserves all contents without internal/external dependencies: slides, paragraphs, tables, lists, text boxes, shapes...

The merging process also preserves the following contents that include internal/external dependencies:

- styles
- images
- charts
- links
- sections
- audios
- videos
- notes
- comments
- layouts
- handouts
- masters
- themes

If you send some PPTX files to contact[at]phpdocx.com, we'll send the output back after merging them, so you can check the output quality.

Regards.