How to split a single PowerPoint presentation PPTX into separate slides in C# .NET Framework

Splitting up a PPTX into separate slides has never been easier. Just follow this quick step-by-step.

First we must open up the console in Package Manager, then paste in this command, which will cause NuGet to install the Cloudmersive API client for Documents and Conversion.

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

With our installation complete, we can access the API and call the function SplitDocumentPptx, as you can see demonstrated here:

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 SplitDocumentPptxExample{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 SplitDocumentApi();var inputFile = new System.IO.Stream(); // System.IO.Stream | Input file to perform the operation on.var returnDocumentContents = true;  // bool? | Set to true to return the contents of each presentation directly, set to false to only return URLs to each resulting presentation.  Default is true. (optional)try{// Split a single PowerPoint Presentation PPTX into Separate SlidesSplitPptxPresentationResult result = apiInstance.SplitDocumentPptx(inputFile, returnDocumentContents);Debug.WriteLine(result);}catch (Exception e){Debug.Print("Exception when calling SplitDocumentApi.SplitDocumentPptx: " + e.Message );}}}}

Done! Your response will be a set of URLs from which to download each separate PPTX slide.

Image for post
Image for post

Written by

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

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store