user2672399
user2672399

Reputation: 195

Remove all unused Slide Layout from my Master Slide from Powerpoint Presentation using OpenXML SDK

I'm currently working on editing my existing PowerPoint file (.pptx) using OpenXML SDK. Can I know how to remove all unused (unlinked) Slide Layouts from my PowerPoint presentation?

The reason for this is I want to reduce the PPTX file and I have 100+ unused layouts.

Thank you.

Upvotes: 2

Views: 609

Answers (1)

Andrey Potapov
Andrey Potapov

Reputation: 67

It looks like with OpenXML SDK you need to parse all slides and/or slide layouts and check relationships between them. On the other hand, this can be easily done with Aspose.Slides for .NET:

using var presentation = new Presentation("input.pptx");
presentation.LayoutSlides.RemoveUnused();
presentation.Save("output.pptx", SaveFormat.Pptx);

I work as a Support Developer at Aspose.

Upvotes: 1

Related Questions