Merge powerpoint presentations on Apple Silicon
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Is there a way to merge multiple powerpoint (pptx) files into a single .pptx from within the matlab report generator or any other know submission on Apple Silicon? IE - without com objects or activeX? Bonus points if I can then export as a PDF, but this seems like a long shot.
exportToPPTX seems promising, but as of yet I cannot get it to work.
2 Commenti
Divyanshu
il 30 Gen 2024
Modificato: Divyanshu
il 30 Gen 2024
Hi Oran,
Any specific use-case why you want to merge the presentations without using activeX or actxserver or COM objects? I am asking this because it would be relatively easier to merge the presentations using actxserver and similar COM objects.
Risposte (1)
Divyanshu
il 31 Gen 2024
Modificato: Divyanshu
il 31 Gen 2024
Hi Oran,
Without using actxserver a lot of manual-coding is required to merge the presentations specifically using 'mlreportgen'. You can refer the following sample code which can be a possible workaround:
Please refer the following pointers to understand the code:
- This piece of code initially creates two presentations 'file1.pptx' & 'file2.pptx'.
- After that a new slide is added to 'file1' and then we are going to replace the title and contents of this new slide.
- The slide contents are replaced with the current slide of 'file2.pptx'
import mlreportgen.ppt.*
ppt = Presentation('file1.pptx');
open(ppt);
titleSlide = add(ppt,'Title Slide');
replace(titleSlide,'Title','Presentation Title 1');
contentSlide1 = add(ppt,'Title and Content');
replace(contentSlide1,'Title','This is the Title of the Content Slide for Presentation 1');
blankSlide = add(ppt,'Blank');
ppt2 = Presentation('file2.pptx');
open(ppt2);
titleSlide = add(ppt2,'Title Slide');
replace(titleSlide,'Title','Presentation Title 2');
contentSlide2 = add(ppt2,'Title and Content');
replace(contentSlide2,'Title','This is the Title of the Content Slide for Presentation 2');
replace(contentSlide2,'Content','A dummy content for presentation 2');
close(ppt2);
open(ppt);
contentSlide = add(ppt,'Title and Content');
newTitle = contentSlide2.Children(1).Children(1).Children(1).Content; %reading the title from slide of presentation2
newContent = contentSlide2.Children(2).Children(1).Children(1).Content; %reading the content from slide of presentation2
replace(contentSlide,'Title',newTitle);
replace(contentSlide,'Content',newContent);
close(ppt);
rptview(ppt);
Note: I have created only two slides for input presenations and the object which refers the slide of ppt2 is static here and may be required to make it dynamic by attaching to some loop based on use-case.
Hope it helps!
0 Commenti
Vedere anche
Categorie
Scopri di più su MATLAB Report Generator in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!