We're sorry AsposeCloud doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.cloud

Convert PDF document to DOCX and download DOCX in Node.js error

i am trying to convert a pdf to a docx without storing the file to the cloud but im getting as error saying PutConvertDocument is not a function.

here is my code:

try {

            // Invoke Aspose.Pdf Cloud SDK API to convert PDF to DOCX without cloud storage

            pdfApi.PutConvertDocument('docx', null, null, profile, function(responseMessage) {

                    assert.equal(responseMessage.status, 'OK');

                    // Save converted format file from response

                    var outfilename = "profile_out.docx"




        catch (e)


          console.log("exception in example");



is there any other way to do the conversion?


I am afraid currently Aspose.PDF Cloud does not have a completely storage independent API for PDF to DOCX/DOC conversion. However, PutPdfInRequestToDoc API method converts PDF document form request body to storage.

PUT ​/pdf​/convert​/doc Converts PDF document (in request content) to DOC format and uploads resulting file to storage.

thank you very much. I can successfully upload the file and convert it, im now facing trouble when trying to download it. i Get an internal error with the code below.

const name = `Profile_${Math.floor(Math.random() * 1000)}.doc`;

		await pdfApi
			.putPdfInRequestToDoc(name, null, null, null, null, null, null, null, null, null, profile)
			.then((result) => {

				pdfApi.getDocument(name, null, "").then((result) => {
		}catch (e){
		console.log("exception in example");


You need to use the DownloadFile API method to download files from storage. Please check the sample Node.js code for your reference.

 const resultName = "MergingResult.pdf";

//Download file
const localPath = "C:/Temp/" + resultName;

pdfApi.downloadFile(resultName).then((result) => {    
	fs.writeFileSync(localPath, result.body);
    console.log("File Downloaded");    
}).catch(function(err) {
    // Deal with an error