Convert PDF to DOCX in Node.js results missing formatting, words and pictures

Hi, I’m generating a pdf buffer in nodejs, i am trying to convert the pdf buffer into a docx that a user can download. i am running into a few issues, firstly, the file that I get to download has no extension, secondly, after open with word, the word file I get is missing some images and words with ffi or fi have been replaced with spaces. when i do the conversion on the aspose website, the file comes out perfectly but messed up using my own code

My code is as followsa

const { WordsApi, ConvertDocumentRequest } = require("asposewordscloud");
var fs = require('fs');

 // Get Customer ID and Customer Key from https://dashboard.aspose.cloud/
wordsApi = new WordsApi("xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx", "xxxxxxxxxxxxxxxxxxxx");

router.get(
	'/pdf2',
	catchAsync(async (req, res) => {

const pdf = generated using pupeteer from html

 var request = new ConvertDocumentRequest({
                format: "docx",
                document: pdf,
            });

 wordsApi.convertDocument(request).then((result) => {    
 console.log(result.response.statusCode);    
 console.log(result.body.byteLength);    
res.send(result.body);  
 }).catch(function(err) {
 // Deal with an error
 console.log(err);
 });

	})
);

@emil_chigu

We are sorry for the inconvenience. We will appreciate it if you please share your input and output documents with us. It will help us to investigate and address the issue exactly.

HI i thought i had resolved the issue but I’ve attached the pdf i converted and the output docx. Can the profiles remain confidential. when open it on mobile they look even worse or they don’t even open and throw a corrupted file error.

@tilal.ahmad

@emil_chigu

Please elaborate further. If you meant to keep the documents confidential, I have removed the documents from the post after downloading these,

I noticed formatting issues in the output DOCX. However, I could not notice any missing word or picture issues in the output document. I have logged a ticket WORDSCLOUD-1957 for further investigation and rectification. We will notify you as soon as we resolve the issue.

1 Like

Hi, any updates regarding this issue?

@emil_chigu

I am afraid the issue is still pending for investigation in the queue. We will share an update/ETA with you as soon as the issue analysis is completed.