How to Convert ODP to JPG in C# .Net Framework

Cloudmersive
2 min readAug 3, 2020

Today we are going to look at how to convert document files into images, specifically ODP format into a set of JPGs, with one for each slide. We will not be going into excruciating detail about the unbelievably tedious manual process. Instead, I am going to throw you a time-saving lifeline in the form of an API.

To use our API, we will need to first install our client files via this command.

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

Following that, we can go ahead with calling our function:

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 ConvertDocumentOdpToJpgExample{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.var quality = 56;  // int? | Optional; Set the JPEG quality level; lowest quality is 1 (highest compression), highest quality (lowest compression) is 100; recommended value is 75. Default value is 75. (optional)try{// Convert ODP Presentation to JPG/JPEG image arrayOdpToJpgResult result = apiInstance.ConvertDocumentOdpToJpg(inputFile, quality);Debug.WriteLine(result);}catch (Exception e){Debug.Print("Exception when calling ConvertDocumentApi.ConvertDocumentOdpToJpg: " + e.Message );}}}}

Ok, that’s all that needed to be done. You are all set to start converting.

--

--

Cloudmersive

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