DevExpress PowerPoint Presentation API
The DevExpress Presentation API is a cross-platform .NET library that allows you to manage Microsoft PowerPoint presentation files. Use available APIs to create, edit, read, merge, split, print, export, and digitally sign presentations. All this functionality is available in your .NET applications without Microsoft Office dependencies.
Get Started
Install the DevExpress.Docs.Presentation NuGet package
dotnet add package DevExpress.Docs.PresentationCode Example - Create a New Presentation from Scratch
using DevExpress.Docs.Presentation;
//...
// Create a presentation with a single empty slide
Presentation presentation = new Presentation();
// Configure Slide Master
SlideMaster slideMaster = presentation.SlideMasters[0];
slideMaster.Background = new CustomSlideBackground(new SolidFill(Color.FromArgb(194, 228, 249)));
// Add a new slide with content
presentation.Slides.Clear();
Slide slide1 = new Slide(slideMaster.Layouts.Get(SlideLayoutType.Title));
foreach (Shape shape in slide1.Shapes) {
if (shape.Placeholder.Type is PlaceholderType.CenteredTitle) {
TextArea textArea = new TextArea();
TextParagraph paragraph = new TextParagraph();
paragraph.Runs.Add(new TextRun { Text = "Daily Testing Status Report" });
textArea.Paragraphs.Add(paragraph);
shape.TextArea = textArea;
}
if (shape.Placeholder.Type is PlaceholderType.Subtitle) {
TextArea textArea = new TextArea();
TextParagraph paragraph = new TextParagraph();
paragraph.Runs.Add(new TextRun { Text = $"{DateTime.Now: dddd, MMMM d, yyyy}" });
textArea.Paragraphs.Add(paragraph);
shape.TextArea = textArea;
}
}
presentation.Slides.Add(slide1);
// Save Presentation to PPTX
FileStream outputStream = new FileStream(@"D:\mypresentation.pptx", FileMode.Create);
presentation.SaveDocument(outputStream);Code Example - Convert a Presentation to PDF
using DevExpress.Docs.Presentation;
//...
// Load a Presentation
Presentation presentation = new Presentation(File.ReadAllBytes("mypresentation.pptx"));
// Export to PDF
presentation.ExportToPdf(new FileStream(@"D:\exported-document.pdf", FileMode.Create));File Format Support
- Import/Export: PPTX, PPTM, POTX, POTM
- Export Only: PDF
Key Features
- Generate new PowerPoint presentations from scratch using comprehensive APIs
- Merge, copy, and split presentations with full slide control
- Export presentations to PDF with high-quality rendering
- Cross-platform printing support
- 170+ shape types including figures, connectors, tables, and image formats
- Full control over text, paragraph, shape, and slide formatting
- Add, remove, duplicate, and customize slides and layouts
- Extract and modify slide text and speaker notes
- Read and update presentation metadata