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)