Target Platform/Framework: Desktop, Web, Mobile DevExpress Product Libraries Used: .NET Office File API (https://www.devexpress.com/officefileapi) Available in the following DevExpress Subscription(s): Universal, Office File API
$ dotnet add package DevExpress.Docs.PresentationDocumentation | Demo | Getting Started Example | Blog & Feedback | Support
DevExpress Presentation API is a cross-platform .NET library that allows you to manage Microsoft PowerPoint presentation files. Install this package and 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.
DevExpress PowerPoint Presentation API is compatible with the following operating systems and platforms:
dotnet add package DevExpress.Docs.Presentation
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);
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));
DevExpress Presentation API is included in the following DevExpress subscriptions:
Free 30-day evaluation period is available.
DevExpres.Document.Processor - DevExpress Document Processing APIs for Word, Excel, and PDF documents.
dotnet add package DevExpress.Document.Processor
DevExpress.AIIntegration.Docs - AI-powered Extensions for DevExpress Document Processing APIs.
dotnet add package DevExpress.AIIntegration.Docs
Documentation | Demo | Getting Started Example | Blog & Feedback | Support