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.