PowerPoint
The Powerpoint class, a core component of the OpenXMLOffice.Presentation library, empowers developers to create, open, and manipulate PowerPoint (.pptx) files with ease. Whether generating new presentations or working with existing ones, this class provides a simple yet powerful interface for efficient content manipulation. Once modifications are complete, users can effortlessly save the updated presentation.
Usage, Options and Examples
Create or open a pptx file from path
public static CreateNew(){ PowerPoint powerPoint = new(); powerPoint.SaveAs("test.pptx");}
public static OpenExisting(){ PowerPoint powerPoint = new("test.pptx",true, null); powerPoint.SaveAs("/NewPath/file.pptx");}Create or open a pptx object using a stream
public static CreateUsingStream(Stream stream){ PowerPoint powerPoint = new(); powerPoint.SaveAs(stream);}Sample using most of the exposed functions
public static CreateNew(){ PowerPoint powerPoint = new(); // Add Blank Slide To the Blank Presentation // Return Slide Object that can be used to do slide level operation Slide slide = powerPoint.AddSlide(PresentationConstants.SlideLayoutType.BLANK); powerPoint.AddSlide(PresentationConstants.SlideLayoutType.BLANK); Slide slide1 = powerPoint.GetSlideByIndex(1); // Move the Slide Order powerPoint.MoveSlideByIndex(1,0); // Remove Slide and its content from Presentation powerPoint.RemoveSlideByIndex(0); // Save the Opened Presentation powerPoint.SaveAs("test.pptx");}PresentationProperties Options
| Property | Type | Details |
|---|---|---|
| settings | PresentationSettings | Provides Presentation setting options |
| slideMasters | Dictionary<string, PresentationSlideMaster>? | Multi-slide master support is in pipeline |
| theme | ThemePallet | Color template for overall presentation |
PresentationSettings Options
| Property | Type | Details |
|---|---|---|
| isMultiSlideMasterPartPresentation | bool | Get or Set Multi-slide master option |
| isMultiThemePresentation | bool | Get or Set Multi-theme option |
TODO
- Multi Slide Master Support
- Each Slide Master Theme Support