How to Convert ODP to PPTX using Node.js

Cloudmersive
2 min readNov 9, 2023

--

Open Document Presentation files and PowerPoint files are a bit like cousins in the digital presentation space. The latter is clearly more commonly used, however, which makes ODP to PPTX a useful conversion to have at our disposal.

Thankfully, we can easily implement a free ODP to PPTX conversion API into our Node.js applications using the minimal & ready-to-run code examples provided below. This will quickly and securely convert our ODP content in-memory, returning PPTX contents in our response — simple as that.

To structure our API call, we can start by installing the SDK. This requires us either running the below command:

npm install cloudmersive-convert-api-client --save

Or adding the following snippet to our package.json:

  "dependencies": {
"cloudmersive-convert-api-client": "^2.6.3"
}

Now we can include our function to make our request. We’ll need to authorize our request, too, and we can do so for free by including a free-tier API key (these allow up to 800 API calls per month with no additional commitments):

var CloudmersiveConvertApiClient = require('cloudmersive-convert-api-client');
var defaultClient = CloudmersiveConvertApiClient.ApiClient.instance;

// Configure API key authorization: Apikey
var Apikey = defaultClient.authentications['Apikey'];
Apikey.apiKey = 'YOUR API KEY';



var apiInstance = new CloudmersiveConvertApiClient.ConvertDocumentApi();

var inputFile = Buffer.from(fs.readFileSync("C:\\temp\\inputfile").buffer); // File | Input file to perform the operation on.


var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.convertDocumentOdpToPptx(inputFile, callback);

Now we can freely make ODP to PPTX conversions whenever the need arises. Easy!

--

--

Cloudmersive
Cloudmersive

Written by Cloudmersive

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

No responses yet