There might be situations where you need to convert your PowerPoint files to images. For example, to generate thumbnails or to add images of the slides to a document. For such cases, converting PowerPoint files to PNG format will prove to be helpful as PNG is a popular raster graphics format that supports lossless compression. To that end, this article will teach you how to convert your PowerPoint presentations to PNG images using C++.
- C++ API for Converting PowerPoint PPTX/PPT Files to PNG Format
- Converting PowerPoint PPTX/PPT Files to PNG Images using C++
C++ API for Converting PowerPoint PPTX/PPT Files to PNG Format
Aspose.Slides for C++ is a robust and feature-rich API that allows you to create, read, and update PowerPoint files without requiring Microsoft PowerPoint to be installed. Furthermore, the API supports converting PowerPoint presentations to PNG images. You can either install the API through NuGet or download it directly from the Downloads section.
PM> Install-Package Aspose.Slides.Cpp
Convert PowerPoint PPTX/PPT Files to PNG Images using C++
The following are the steps to convert PowerPoint files to PNG images using C++.
- Load the PowerPoint file using the Presentation class.
- Set the desired dimensions for the images to be generated.
- Loop through the slides of the presentation.
- Generate the image of each slide using the ISlide->GetThumbnail(float scaleX, float scaleY) method.
- Save the PNG image using the Bitmap->Save(const String & filename, const Imaging::ImageFormatPtr & format) method.
The following sample code shows how to convert PowerPoint files to PNG images using C++.
Get a Free License
In order to try the API without evaluation limitations, you can request a free temporary license.
In this article, you have learned how to convert PowerPoint files to PNG images using C++. We used the Aspose.Slides for C++ API to achieve this. It is a powerful API that provides a bunch of additional features for working with PowerPoint files. You can explore the API in detail by visiting the official documentation. In case of any queries, please feel free to reach us at our free support forum.