How to convert a PowerPoint PPTX to a PNG Array in C# .NET Framework

Cloudmersive
1 min readJul 25, 2020

--

Sometimes PPTX format can be quite inconvenient, leading to all sorts of problems with compatibility. To solve this problem once and for all, we will be exploring a solution today that will allow us to convert PPTX files into arrays of PNG images. This will take just a handful of minutes, mostly just waiting for our package to install and testing it.

So let’s grab that package first:

Install-Package Cloudmersive.APIClient.NET.DocumentAndDataConvert -Version 3.2.8

And next we will call our function for converting between the formats:

using System;using System.Diagnostics;using Cloudmersive.APIClient.NET.DocumentAndDataConvert.Api;using Cloudmersive.APIClient.NET.DocumentAndDataConvert.Client;using Cloudmersive.APIClient.NET.DocumentAndDataConvert.Model;namespace Example{public class ConvertDocumentPptxToPngExample{public void main(){// Configure API key authorization: ApikeyConfiguration.Default.AddApiKey("Apikey", "YOUR_API_KEY");// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed// Configuration.Default.AddApiKeyPrefix("Apikey", "Bearer");var apiInstance = new ConvertDocumentApi();var inputFile = new System.IO.Stream(); // System.IO.Stream | Input file to perform the operation on.try{// Convert PowerPoint PPTX to PNG image arrayPptxToPngResult result = apiInstance.ConvertDocumentPptxToPng(inputFile);Debug.WriteLine(result);}catch (Exception e){Debug.Print("Exception when calling ConvertDocumentApi.ConvertDocumentPptxToPng: " + e.Message );}}}}

And that’s really all there is to it!

--

--

Cloudmersive
Cloudmersive

Written by Cloudmersive

There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.

No responses yet