How to get Images from an Excel XLSX Spreadsheet in Node.JS

Cloudmersive
1 min readApr 21, 2020

--

Today’s goal is simple: we are just looking to set up image extraction for excel spreadsheets. No more, no less. I don’t know about you, but setting up this functionality from scratch doesn’t seem like a very appealing idea. Luckily, we have an API ready to go for just this situation. Here’s how to apply it to this particular problem.

Start with this command for installation of the client:

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

Next call editDocumentXlsxGetImages, which I’ve taken the liberty of providing 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 input = new CloudmersiveConvertApiClient.GetXlsxImagesRequest(); // GetXlsxImagesRequest | Document input requestvar callback = function(error, data, response) {if (error) {console.error(error);} else {console.log('API called successfully. Returned data: ' + data);}};apiInstance.editDocumentXlsxGetImages(input, callback);

And that about does it. Provide an Excel file and the API will, in turn, provide your images. Simple.

--

--

Cloudmersive

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