With the release of Essential Studio® 2015 Volume 1, Syncfusion introduced the beta version of Essential Presentation, a new .NET library that can read, write, convert, and create raster images from Microsoft PowerPoint files. It provides a rich object model similar to Syncfusion’s file format libraries: XlsIO, DocIO, and PDF. This library can be used with Windows Forms, WPF, ASP.NET, and ASP.NET MVC applications. As it does not depend on Microsoft Office or any other external software, this library can be used on the server side without any difficulty. Keep in mind that this version of Essential Presentation supports only PowerPoint 2007-2013 (.pptx) files.
Note: Since this version of Essential Presentation is in beta, it does not have some features found in Microsoft PowerPoint such as WordArt, SmartArt, slide notes, master-slide editing, animations, transitions, comments, headers, footers, OLE objects, handouts, equations, and built-in themes.
In order to create and modify a PowerPoint presentation, you need to know how the elements are organized in Essential Presentation’s document object model (DOM). The following figure illustrates this DOM.
We have published resources explaining in detail on how to get started using the presentation library:
The following code snippet creates a simple PowerPoint presentation with two slides.
private static void CreateSlide2(IPresentation presentation) { //Create a slide with a blank layout. ISlide slide2 = presentation.Slides.Add(SlideLayoutType.Blank); //Add a text box for entering the title of the slide and set its vertical align as middle. IShape titleShape = slide2.AddTextBox(66.24, 28.8, 828, 104.4); titleShape.TextBody.VerticalAlignment = VerticalAlignmentType.Middle; //Add a paragraph into the title shape and set its vertical alignment as center. IParagraph paragraph = titleShape.TextBody.AddParagraph(); paragraph.HorizontalAlignment = HorizontalAlignmentType.Center; //Create an instance of ITextPart and set the text and its formatting. ITextPart textPart1 = paragraph.AddTextPart(); textPart1.Text = "Northwind Database"; textPart1.Font.FontName = "Calibri Light"; textPart1.Font.FontSize = 44; //Add a new text box for the content of the slide and set its vertical alignment as top. IShape contentShape = slide2.AddTextBox(66.24, 144, 828, 342.72); contentShape.TextBody.VerticalAlignment = VerticalAlignmentType.Top; //Add a paragraph into the body of content shape. IParagraph para = contentShape.TextBody.AddParagraph(); //Set the list format type as Numbered and the numbering style as Arabic followed by a period. para.ListFormat.Type = ListType.Numbered; para.ListFormat.NumberStyle = NumberedListStyle.ArabicPeriod; //Set the paragraph indentation as suitable for a list and add a space before the start of the paragraph. para.SpaceBefore = 10; para.LeftIndent = 40; para.FirstLineIndent = -40; //Add a text part and set the text and its formatting. ITextPart textPart2 = para.AddTextPart(); textPart2.Text = "Suppliers of Northwind – who supply to the company."; textPart2.Font.FontName = "Calibri"; textPart2.Font.FontSize = 28; para = contentShape.TextBody.AddParagraph(); para.ListFormat.Type = ListType.Numbered; para.ListFormat.NumberStyle = NumberedListStyle.ArabicPeriod; para.SpaceBefore = 10; para.LeftIndent = 40; para.FirstLineIndent = -40; ITextPart textPart4 = para.AddTextPart(); textPart4.Text = "Customers of Northwind – who buy from Northwind."; textPart4.Font.FontName = "Calibri"; textPart4.Font.FontSize = 28; para = contentShape.TextBody.AddParagraph(); para.ListFormat.Type = ListType.Numbered; para.ListFormat.NumberStyle = NumberedListStyle.ArabicPeriod; para.SpaceBefore = 10; para.LeftIndent = 40; para.FirstLineIndent = -40; ITextPart textPart5 = para.AddTextPart(); textPart5.Text = "Employee details of Northwind traders – who work for Northwind."; textPart5.Font.FontName = "Calibri"; textPart5.Font.FontSize = 28; }
Now that you know the basics of getting started, take a look at our online live demos for Essential Presentation. They serve as a good launching from which you can experiment with some of the features we’ve discussed.