The Syncfusion .NET PowerPoint Library offers powerful and comprehensive APIs to convert a PowerPoint document into an image programmatically with a few lines of code and without Microsoft PowerPoint or interop dependencies. It allows you to convert an entire presentation into images or a single slide of a presentation into an image to provide the document’s preview or thumbnail or to print it.
Convert complex PowerPoint presentations into image files in a batch process, faster than Office automation libraries.
Convert PowerPoint presentations to image files in partial trust environments like Azure and AWS.
PowerPoint Library is a non-UI component for automating the conversion of PowerPoint presentations into images in .NET Framework, .NET Core, Blazor, Xamarin, and .NET MAUI applications.
Here is an example of how to convert a PowerPoint presentation into images in C# using the Syncfusion .NET PowerPoint Library.
- //Open an existing presentation.
- using FileStream inputStream = new FileStream("Template.pptx", FileMode.Open, FileAccess.Read);
- using IPresentation presentation = Presentation.Open(inputStream);
-
- //Initialize PresentationRenderer.
- presentation.PresentationRenderer = new PresentationRenderer();
-
- //Render the PowerPoint presentation as image stream.
- Stream[] imageStreams = presentation.RenderAsImages(ExportImageFormat.Png);
-
- //Save the image streams to file.
- for(int i =0; i<imageStreams.Length; i++)
- {
- Stream imageStream = imageStreams[i];
- imageStream.Position = 0;
- using FileStream outputStream = new FileStream("Image" + i.ToString() + ".png", FileMode.Create, FileAccess.ReadWrite);
- imageStream.CopyTo(outputStream);
- imageStream.Dispose();
- }
Here is an example of how to convert a PowerPoint slide to an image in C# using the Syncfusion .NET PowerPoint Library.
- //Open an existing presentation.
- using FileStream inputStream = new FileStream("Template.pptx", FileMode.Open, FileAccess.Read);
- using IPresentation presentation = Presentation.Open(inputStream);
-
- //Initialize PresentationRenderer.
- presentation.PresentationRenderer = new PresentationRenderer();
-
- //Render the PowerPoint slide as image stream.
- using Stream imageStream = presentation.Slides[0].ConvertToImage(ExportImageFormat.Png);
-
- //Save the image stream to file.
- using FileStream outputStream = new FileStream("Image.png", FileMode.Create, FileAccess.ReadWrite);
- imageStream.CopyTo(outputStream);
Convert a specific slide in a presentation document into an image.
The built-in font substitution event allows users to choose alternate fonts from the device or upload fonts with a few lines of code.
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.