Conversion from Docx (Word) to PDF - The output file is not viewable in Adobe

The output data produced is corrupt according to Adobe and another PDF viewer. What am I doing wrong. This is nodejs. Code below.

const { WordsApi, ConvertDocumentRequest } = require(“asposewordscloud”);
const fs = require(‘fs’);

var appSid = “xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx”;
var appKey = “xxxxxxxxxxxxxxxxxxxxxxxxxxxxx”;

var wordsApi = new WordsApi(appSid, appKey);

var request = new ConvertDocumentRequest({
format: “pdf”,
document: fs.createReadStream(DownloadPath+filesep+docxfile),
});

wordsApi.convertDocument(request).then((result) => {
console.log('StatusCode - ',result.response.statusCode);
console.log('byteLength - ',result.body.byteLength);
fs.writeFileSync(DownloadPath+filesep+gReportFileName, result.body);
}).catch(function(err) {
console.log(‘Error:’, err);
});

Using version 22.12.0 Nodejs sdk

@IansResearch

We have noticed the issue and logged a ticket (WORDSCLOUD-2184) for further investigation. We will keep you updated about the issue resolution progress within this forum thread.