RTF to DOCX using node

I’m trying convert rtf to docx with node. The file it produces is corrupted and cannot be opened in word.

And sometimes it does not work at all and just hangs on the convert request.
I’m attaching the docx it produced.

My code:

import * as fs from “fs”;
import { WordsApi, ConvertDocumentRequest, DownloadFileRequest} from “asposewordscloud”;

const clientId = “xx”;
const secret = “xx”
const wordsApi = new WordsApi(clientId, secret);

const requestDocument = fs.createReadStream(“test.rtf”);
const convertRequest = new ConvertDocumentRequest({
document: requestDocument,
format: “docx”
});
const convertResult = await wordsApi.convertDocument(convertRequest);

fs.writeFileSync(“converted.docx”, convertResult.body);
converted.docx (26.1 KB)
converted.docx (26.1 KB)

@ProSyn

I have tested the latest version of Aspose.Words Cloud SDK for Node.js and it is working fine. Please try the latest SDK version of Aspose.Words Cloud SDK for Node.js, it will resolve the issue.

Upgrading the aspose package sorted out the corruption issue.
I still have the problem with the operation hanging sometimes.
I’ve just tried to batch convert 155 documents. It worked for 154 and now it hangs on the last one, for some reason.

@ProSyn

It is good to know that you have managed to resolve your issue.

I am afraid it is difficult to comment on the issue without replicating it at our side. Can you please check the file 155 separately and confirm whether it is a file related issue or some other?

The issue was solved. The problem was, obviously, in my code.

@ProSyn

It is good to know that you have managed to resolve the issue. Please feel free to contact us for any further assistance.