word to odt

Convert Word Document to ODT format using Node.js API.

Microsoft Word documents are widely used, but when it comes to open-source platforms like LibreOffice or cross-platform compatibility, converting Word documents to the OpenDocument Text (ODT) format becomes essential. The ODT format is ideal for long-term document storage, open standard’s compliance, and accessibility.

In this article, we’ll walk you through converting Word DOCX to ODT using the Aspose.Words Cloud SDK for Node.js.

Why Convert Word to ODT?

  • Fully compatible with LibreOffice, OpenOffice, and other open-source suites.
  • Based on open XML standards for long-term sustainability.
  • Ensures platform-agnostic editing.
  • Ideal for governments, educational institutions, and enterprise users promoting open formats.

Let’s discuss further topics in more details:

API for Word to ODT Conversion

The Aspose.Words Cloud SDK for Node.js enables developers to easily integrate Word to ODT conversion capabilities into their applications. The SDK offers secure, scalable, and high-fidelity document transformation using simple RESTful APIs.

Key Features:

  • Convert DOC, DOCX, DOT to ODT with high accuracy.
  • Cloud-based solution with encrypted API access.
  • No need for Microsoft Office or OpenOffice installations.
  • Maintains structure, formatting, and styles.

Prerequisites

  1. Create an account at Aspose.Cloud Dashboard to get your Client ID and Client Secret.
  2. Install the Node.js SDK:
npm install asposewordscloud --save

Convert DOCX to ODT in Node.js

Let’s explore how to convert Word documents to ODT using Node.js.

Step 1 - Create an instance of WordsApi class.

const { WordsApi } = require("asposewordscloud");
const wordsApi = new WordsApi("YOUR_CLIENT_ID", "YOUR_CLIENT_SECRET");

Step 2 – Upload DOCX File to the Cloud storage:

Step 3 – Convert DOCX to ODT format

const { ConvertDocumentRequest } = require("asposewordscloud");

const convertRequest = new ConvertDocumentRequest({
  documentName: "sample.docx",
  format: "odt",
  outPath: "converted/resultant.odt"
});

const result = await wordsApi.convertDocument(convertRequest);
console.log("Word to EPUB conversion completed successfully.");
word to odt

A preview of Word to ODT conversion.

The sample Word document and resultant image generated above can be downloaded from:

Convert Word to ODT using cURL

Prefer command-line tools? Here’s how to convert DOCX to ODT using cURL:

Step 1- Generate JWT access token:

curl -v "https://api.aspose.cloud/connect/token" \
 -X POST \
 -d "grant_type=client_credentials&client_id=CLIENT_ID&client_secret=CLIENT_SECRET" \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -H "Accept: application/json"

Step 2 – Make DOCX to ODT Conversion Request:

curl -v "https://api.aspose.cloud/v4.0/words/convert?format=odt" \
-X PUT \
-H "Authorization: Bearer <ACCESS_TOKEN>" \
-H "Content-Type: multipart/form-data" \
-d "@input-sample.docx" 

Replace:

  • sourceFile with your Word document name.
  • <ACCESS_TOKEN> with your generated token.

Try Online DOCX to ODT Converter

Want to try before coding? Use our Free Online DOCX to ODT Converter built with Aspose.Words REST API.

convert docx to odt online

Free DOCX to ODT Conversion App.

Conclusion

Using Aspose.Words Cloud SDK for Node.js, you can easily integrate DOCX to ODT conversion into your apps or workflows. Whether you’re working in education, government, or enterprise environments, this RESTful solution offers reliability, scalability, and seamless open-format export.

Useful Resources

We highly recommend visiting the following blogs: