How to Convert an ODS File to XLSX in JavaScript

Cloudmersive
2 min readMar 23, 2021

--

While the OpenOffice platform provides a free and easy-to-use option for users, it can present compatibility issues to partners who use the Office suite. If you employed the more cost-efficient OpenDocument Spreadsheet (ODS) format to create your file, converting it to the Excel format will allow you to share your data without loss of quality or formatting. The following tutorial will show you how to automatically convert ODS to XLSX using an API in JavaScript.

Our first step is to run this command to install jQuery:

bower install jquery

Once the installation is complete, we can call our document conversion function:

var form = new FormData();
form.append("inputFile", fileInput.files[0], "file");
var settings = {
"url": "https://api.cloudmersive.com/convert/ods/to/xlsx",
"method": "POST",
"timeout": 0,
"headers": {
"Content-Type": "multipart/form-data",
"Apikey": "YOUR-API-KEY-HERE"
},
"processData": false,
"mimeType": "multipart/form-data",
"contentType": false,
"data": form
};
$.ajax(settings).done(function (response) {
console.log(response);
});

Your newly created Excel file should now be ready to share! In order for the process to run smoothly, the only parameters are the input file and your API key. If you don’t already have an API key, you can register for a free account on the Cloudmersive website and gain access to 800 calls/month across our library of APIs.

--

--

Cloudmersive
Cloudmersive

Written by Cloudmersive

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

No responses yet