Convert PDF to Word file in Node.js lose the Progress Bars Images

Hey,

I’m using Groupdocs conversion API using Node.js to convert PDF to WORD.
I’m able to convert PDF to WORD but the converted word document is not 100% identical to the PDF file.
I’ve attaching both PDF and the converted Word file, In this I’m not getting the progress bars filled in bottom left section
I want the Word file to be identical to PDF, I’m using Paid API plan in my application,
For ease, I’ve also tried with Groupdocs website to convert but still getting same,
I’ve tried to convert this PDF on GroupDocs Online converter also, with the parameters
Width: 1050
Height: 1450
and I’m getting the word file as output that I attached.
The converted file is almost Identical but the progress bars are not filled as they are in the PDF in bottom left section

I’m using this on Windows 10 and I’ve attached my input and output documents

Please let us know, is there any solution for the same.

Any help would be greatly appreciated.

Thanks

input.pdf (6.1 KB)

input.pdf (6.13 KB)
output.docx (20.4 KB)

@CVJURY

I have tested the scenario using the latest version of GroupDocs.Conversion Cloud SDK for Node and unable to notice the issue. Please double check that you are using the latest SDK. Otherwise, please share your sample code with us for further investigation.
output_gd.docx (19.3 KB)

// load the module
var GroupDocs = require('groupdocs-conversion-cloud');
var fs = require('fs');

// get your appSid and appKey at https://dashboard.groupdocs.cloud (free registration is required).
var appSid = "xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx";
var appKey = "xxxxxxxxxxxxxxxxxxxxxxxxxxxx";


// construct Api
var api = GroupDocs.ConvertApi.fromKeys(appSid, appKey);

 var options = new GroupDocs.DocxConvertOptions();
	options.width=1050
	options.height=1450
 var settings = new GroupDocs.ConvertSettings();
            settings.filePath ="input.pdf";
            settings.format = "docx";
            settings.convertOptions = options;
	    settings.outputPath="output_gd.docx"
 
var request = new GroupDocs.ConvertDocumentRequest(settings);
//console.log(request); 
 api.convertDocument(request)
                .then((result) => {    
    console.log(result); 			    

}).catch(function(err) {
    // Deal with an error
    console.log(err);
});
1 Like

@tilal.ahmad

Thank you for detailed reply,
I’m not able to view the output docx you attached, as it’s private.
But with the code provided by you I was able to convert the word document right but only for that particular PDF.
I was using the latest SDK before but I was using code differently where, for width and height option I was using PDFConvertOptions instead of DocxConvertOptions.
Now, it seems to be working fine for that progress bar issue but there are few other case that it’s not working fine for same progress bars.

This is happening in many PDF’s where progress bars are overlapping the text in converted word document
I’m attaching few input PDF’s, and converted docx. when I’m converting these, progress bar is overlapping the text above them.

input1.pdf (5.6 KB)
output1.docx (16.8 KB)

input2.pdf (6.2 KB)
output2.docx (19.5 KB)

Please let us know, is there any solution for the same.

Thanks.

@bharat2913

Thanks for your detailed feedback. I have tested the scenario with shared PDF documents and noticed that text is overlapping on progress barcode images. So I logged a ticket(CONVERSIONCLOUD-489) for further investigation and rectification. We will keep you updated about the issue resolution progress in this forum thread.

1 Like

@tilal.ahmad

Thanks for looking into it.

1 Like

@tilal.ahmad
Ref - CONVERSIONCLOUD-489
Was there any update on this? TIA

@CVJURY

I am afraid we cannot share any ETA at the moment as we have recently noticed the issue and it is pending for investigation in the queue. We will share an update/ETA as soon as the investigation is completed.

@tilal.ahmad

Hey, Tilal
Was there any update on this?
Ref - CONVERSIONCLOUD-489

@CVJURY

The issue is still not resolved. We discovered the issue in the parent on-premise API GroupDocs.Conversion for .NET after an initial investigation. As a result, we have opened an internal ticket to fix GroupDocs.Conversion for .NET. We will export the fix to the GropDocs.Conversion Cloud API as soon as the issue is resolved in the parent API. We will keep you updated on the progress of the problem resolution.

@tilal.ahmad
Hey, Tilal
Was there any update on this?
Ref - CONVERSIONCLOUD-489

@CVJURY

The issue is still not resolved. We will notify you as soon as we have an update.

@tilal.ahmad
Hey, Tilal
Wass there any update on this issue?
Ref - CONVERSIONCLOUD-489

@CVJURY

The issue resolution in GroupDocs.Conversion for .NET is still in progress. As soon as it is fixed in the parent API, we will import the fix in GroupDocs.Conversion Cloud and notify you.

The issues you have found earlier (filed as CONVERSIONCLOUD-489) have been fixed in this update. This message was posted using Bugs notification tool by sergeiterentev

@tilal.ahmad
Hey, Tilal

I’m converting PDF to DOCX
I’m getting right converted file from the groupdocs convertor but not getting same when I’m trying to convert via node API.

I’m currently using this code to convert PDF to DOCX

// initialize api

  let convertApi = groupdocs_conversion_cloud.ConvertApi.fromKeys(

    clientId,

    clientSecret

  );

  // define convert settings

  let settings = new groupdocs_conversion_cloud.ConvertSettings();

  let convertOptions = new groupdocs_conversion_cloud.DocxConvertOptions();

  convertOptions.width = 1050;

  convertOptions.height = 1475;

  settings.convertOptions = convertOptions;

  settings.filePath = `${params.documentName}.pdf`; // input file path on the cloud

  settings.format = 'docx'; // output format

  settings.outputPath = 'output'; // output file folder on the cloud

  console.log('Conerting PDF ... ');

  // create convert document request

  let request = new groupdocs_conversion_cloud.ConvertDocumentRequest(settings);

  // convert document

  let result = await convertApi.convertDocument(request);

Can you refer me to the documentation for the updated API that is specific to nodejs. I’m unable to find one for nodejs.

Thanks

@CVJURY

Please note in the latest release GroupDocs.Conversion Cloud 23.2, there are new options added that can fix the issue. Instead of setting width and height options, set page size option like this:

options.pageSize = GroupDocs.WordProcessingConvertOptions.PageSizeEnum.Custom;

This will prevent document resize during conversion and will keep original formatting.

Thanks @tilal.ahmad. this was a great help.

With this I was actually able to solve most of my designs conversions.
but now I’m facing conversion problem with a few designs,

  1. I’m not able to convert multipage PDF into DOCX correctly from API but this is converting fine from the groupdocs convertor .
    I want to convert this test38.pdf (9.8 KB) PDF into DOCX.
    From my conversion I’m getting this output test38.docx (19.9 KB), very messed up. but this is converting fine in the groupdocs convertor.
    I think I’m missing something in the code, I didn’t find any specific documentation for converting multipage PDF into DOCX with Nodejs.
    I’m using the same code above, just removed the width and height and added ‘pageSize’ option as you suggested.
    Please let me know how we can fix this or If there is any specific documentation for this, please refer me to that.

  2. When I’m trying to convert this test21.pdf (12.8 KB) PDF into DOCX
    I’m getting this output test21.docx (31.3 KB).
    Here at the vary bottom in the converted doc if you check, “Progrss Dots” are coming a bit off.
    With this one also if I try to convert from groupdocs convertor, I’m getting exact results. “Progress dots” are coming as they are in PDF but does not come same with the API conversion.

Please let me know, How we can fix these.

Thanks

@CVJURY

We will investigate the issue and guide you accordingly.

Thankyou @tilal.ahmad

@CVJURY

I am unable to reproduce the issue using GroupDocs.Conversion Cloud SDK for Node.js 23.2. Please find the sample output. If you still facing the issue, then please share your sample code to reproduce the issue.
test38_gd.docx (20.5 KB)