How to delete slides from a PowerPoint PPTX presentation document in Node.JS

I am about to make your life a whole lot easier. With a simple API function call, I will show you how to delete PowerPoint slides in Node.JS in a matter of just a couple of minutes.

Our client needs to be installed first, using this reference for package.json.

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

And now we may call editDocumentPptxDeleteSlides, which will require you to instantiate an API object, all of which you can see in the example below.

var CloudmersiveConvertApiClient = require('cloudmersive-convert-api-client');var defaultClient = CloudmersiveConvertApiClient.ApiClient.instance;// Configure API key authorization: Apikeyvar Apikey = defaultClient.authentications['Apikey'];Apikey.apiKey = 'YOUR API KEY';// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)//Apikey.apiKeyPrefix = 'Token';var apiInstance = new CloudmersiveConvertApiClient.EditDocumentApi();var reqConfig = new CloudmersiveConvertApiClient.RemovePptxSlidesRequest(); // RemovePptxSlidesRequest | Presentation input requestvar callback = function(error, data, response) {if (error) {console.error(error);} else {console.log('API called successfully. Returned data: ' + data);}};apiInstance.editDocumentPptxDeleteSlides(reqConfig, callback);

And that about does it for this lesson; you’re done. If you need other PowerPoint related functions, or those relating to other document files in general, the rest of this library is going to be your best friend.

--

--

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
Cloudmersive

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