There could be various scenarios when you need to convert PowerPoint PPT or PPTX to JPG images. For example, you may need to slide show the PPT/PPTX presentation in read-only mode within your application or you may want to generate the thumbnail for every slide of the PowerPoint presentation and etc. In order to automate PowerPoint to JPG conversion, I’ll show you how to convert PPT or PPTX slides to JPG images programmatically in C# .NET.
TIP:
You may want to check out Aspose free PowerPoint to JPG or PPTX to JPG converter.
Converting PPT or PPTX to JPG Images in C#
In order to convert PPT(X) to JPG images, we’ll use Aspose.Slides for .NET which is a complete .NET package for PowerPoint automation. The API provides high-quality conversion of PowerPoint presentations to various file formats including JPG.
You can either download and reference the API’s DLL or install the package using NuGet Package Manager or Package Manager Console.
Using NuGet Package Manager
Using the Package Manager Console
PM> Install-Package Aspose.Slides
Convert PowerPoint PPT to JPG in C#
The following are the steps to convert PPT to JPG using Aspose.Slides for .NET.
- Create an instance of Presentation class and initialize it with a PowerPoint presentation’s path.
- Use ISlide interface to access the PPT slides from Presentation.Slides collection.
- Get slide’s thumbnail into Bitmap object using ISlide.GetThumbnail(float scaleX, float scaleY) method.
- Save PPT slide as JPG image using Image.Save(string filename, ImageFormat format) method.
The following code sample shows how to convert PPT to JPG images in C#.
PowerPoint Presentation
Converted JPG Images
Convert PowerPoint PPTX to JPG with Customized Dimensions in C#
You may also customize the dimensions of the JPG images as per your requirements. The following code sample shows how to define ScaleX and ScaleY values while converting PPTX to JPG in C#.
Get a Free Temporary License for Aspose.Slides for .NET
You can get a free temporary license for Aspose.Slides for .NET to avoid the trial limitations.