Closed jhaase1 closed 8 months ago
I was playing around a bit with some modifications of ppt/presentation.xml
.
You could try this:
let pres = automizer
.loadRoot(`RootTemplate.pptx`)
.load(`SlideWithCharts.pptx`, 'charts');
pres.addSlide('charts', 1, async (slide) => {
//
});
pres.modify((presXml: XmlDocument) => {
const slideMasters =
ModifyPresentationHelper.getSlideMastersCollection(presXml);
// You can basically rearrange the slideMasters collection
XmlHelper.sortCollection(slideMasters, [1, 0]);
// And also remove slideMasters
XmlHelper.sliceCollection(slideMasters, 1, 0);
});
The problems are:
This is because of ModifyPresentationHelper.normalizeSlideMasterIds
is not working properly when the first id
was cut out (see currentId
). The above should work if the first (unmodified) master is kept in place.
p:sldMasterId
-ids and p:sldLayoutId
-ids need to be in a row, otherwise PowerPoint will complain on any p:sldLayoutId
-id lower than its corresponding slideMaster
-id.
Both these questions relate to operations that seem nearly possible given the functionality in ModifyPresentationHelper. Is it possible to
This is trying to work around the inability to modify in place and replace the original version of the slide master with the new modified version.