How to convert a PowerPoint PPTX to Text TXT in C# .NET Framework
1 min readFeb 9, 2020
Need to set up conversion between PPTX and TXT? Get ready to save a ton of time.
Installing our API client is first on today’s agenda. Not bad, just paste this command into the console of Package Manager.
Install-Package Cloudmersive.APIClient.NET.DocumentAndDataConvert -Version 2.2.0
With our client ready, we can drop our PowerPoint presentation right into the ConvertDocumentPptxToTxt function, as you see 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 ConvertDocumentPptxToTxtExample{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 Presentation to Text (txt)TextConversionResult result = apiInstance.ConvertDocumentPptxToTxt(inputFile);Debug.WriteLine(result);}catch (Exception e){Debug.Print("Exception when calling ConvertDocumentApi.ConvertDocumentPptxToTxt: " + e.Message );}}}}
Guess what, you are already done! Take the rest of the day off. Or spend a few minutes reading our other ultra-fast tutorials, covering such useful functions as document editing, PDF conversion, and validation.