How to Convert Keynote KEY to JPG in Node.JS

Got a bunch of Mac Keynote presentations that you don’t know what to do with? Today we are going to convert their constituent slides into JPG images to provide maximum convenience. You will be amazed at just how quickly this can be accomplished if you approach the problem in the right way. In this case, the right way is the easiest way possible.

For maximum speed with minimal effort, we will use an API to perform our conversions. Let’s install it now:

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

Now call convertDocumentKeynoteToJpg, and give it an inputFile. You can optionally specify a quality value for your JPGs.

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.ConvertDocumentApi();var inputFile = "/path/to/file"; // File | Input file to perform the operation on.var opts = {'quality': 56 // Number | 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.};var callback = function(error, data, response) {if (error) {console.error(error);} else {console.log('API called successfully. Returned data: ' + data);}};apiInstance.convertDocumentKeynoteToJpg(inputFile, opts, callback);


Image for post

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