We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Syncfusion Feedback


Trusted by the world’s leading companies

Overview

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.


Key features

Fast and reliable

Convert complex PowerPoint presentations into image files in a batch process, faster than Office automation libraries.

Partial trust environment

Convert PowerPoint presentations to image files in partial trust environments like Azure and AWS.

Platform independent

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.


How to convert a PowerPoint presentation to images in C#

  1. Install NuGet package: Install the Syncfusion.PresentationRenderer.Net.Core NuGet package in your project.
  2. Open PowerPoint document: Create a FileStream object to represent the input PowerPoint document.
  3. Load in .NET PowerPoint Library: Create an IPresentation object by passing the FileStream object.
  4. Convert PowerPoint to images: Convert the entire PowerPoint presentation into images using the RenderAsImages method and save the images to a FileStream object.

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();
}

How to convert a PowerPoint slide to an image in C#

  1. Install NuGet package: Install the Syncfusion.PresentationRenderer.Net.Core NuGet package in your project.
  2. Open PowerPoint document: Create a FileStream object to represent the input PowerPoint document.
  3. Load in .NET PowerPoint Library: Create an IPresentation object by passing the FileStream object.
  4. Convert PowerPoint to images: Convert the entire PowerPoint slide into an image using the ConvertToImage method of ISlide and save the image to a FileStream object.

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);

Presentation-to-image conversion options

Specific slide

Convert a specific slide in a presentation document into an image.

Font substitution

The built-in font substitution event allows users to choose alternate fonts from the device or upload fonts with a few lines of code.



Awards

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.

Scroll up icon