The Syncfusion .NET PowerPoint Library (Essential Presentation) enables the seamless creation, customization, and removal of shapes in PowerPoint presentations programmatically using C#. It eliminates the need for Microsoft PowerPoint or interop dependencies and offers a lightweight and efficient solution for managing shapes.
This example code shows how to create a shape in a PowerPoint using the Syncfusion .NET PowerPoint Library with just few lines of code in C#.
using Syncfusion.Presentation;
//Load or open an PowerPoint Presentation
using IPresentation pptxDoc = Presentation.Create();
//Add a blank slide to Presentation
ISlide slide = pptxDoc.Slides.Add(SlideLayoutType.Blank);
//Add normal shape to slide
slide.Shapes.AddShape(AutoShapeType.Cube, 50, 200, 300, 300);
//Get a picture as stream
using FileStream imageStream = new FileStream(Path.GetFullPath(@"Image.jpg"), FileMode.Open);
//Add picture to the shape collection
IPicture picture = slide.Shapes.AddPicture(imageStream, 373, 83, 526, 382);
using FileStream outputStream = new(Path.GetFullPath(@"Result.pptx"), FileMode.Create, FileAccess.ReadWrite);
pptxDoc.Save(outputStream);
Format the PowerPoint shapes programmatically, including adjusting the fill and modifying the line formats.
Create, format, and remove grouped shapes in PowerPoint presentations.
Explore these resources for comprehensive guides, knowledge base articles, insightful blogs, and ebooks.
Product Updates
Technical Support
Yes, you can modify the properties of a shape, such as the line format and fill, using the .NET PowerPoint Library.
Yes, you can iterate through the shapes of a group and remove a particular shape using the .NET PowerPoint Library.
Detailed code samples are available in the documentation and on GitHub.
Yes, you can create a shape group in a presentation using the .NET PowerPoint Library.
The .NET PowerPoint Library supports 160+ predefined shapes.
Integrating the creation of shapes in PowerPoints into your application is straightforward. You can access the feature through the Syncfusion.Presentation.Net.Core NuGet package.
Greatness—it’s one thing to say you have it, but it means more when others recognize it. Syncfusion® is proud to hold the following industry awards.