OpenXML - PresentationML Cloning - Corrupts Powerpoint

1k views Asked by At

My need is to clone all slides in a presentation to a base presentation and change the layout of the cloned slides to the layout of the base presentation.

The approach I took was,

(Base presentation denoted as B, to be cloned presentation is denoted as C)

Copy the slide parts of each slide of C into B.

Copy the masters of the B into C

Delete existing layout parts of the newly added slides pars in B(cloned slides from C).

Add the required layout part from B to the newly added slide parts.

Traverse through LayoutId's and re order them to contain unique values.

The result presentation is a corrupted output.

Base presentation: Base presentation

Clone presentation: Clone presentation

Error message: Error message

Resulting output: Resulting output

The first slide gets corrupted

I also tried presentation builder mentioned at, openxmldeveloper

The option 2 of the given snippet is somewhat similar to what i'm trying to achieve. But the resulting output was the same.

The presentation builder project, with the files I'm trying to clone can be downloaded from here

In here we try to clone both presentation documents to a new presentation document (built from scratch), but use the master and layouts of the first cloned presentation (base presentation) for all the slides.

Files: Companies.pptx (basepresentation), Customer Content.pptx (clone presentation), Out2.pptx (resulting presentation)

1

There are 1 answers

0
Yasindu On

For anyone who are using or taking the same path as I am, Eric White has corrected the issue and uploaded the next version of presentation builder.

The answer and the corrected code can be found at openxmldeveloper

Cheers