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

Free Support Forum - aspose.com

Pdf converted to DOCX gives empty document

Dear Support.


I am trying to save PDF document to .DOCX using DocsSaveOptions. On save, document is empty.

I have attached code snippet used. Please suggest what is problem?


String filePath = "/Users/ganesh-2007/Downloads/resumes/AarthiShreyasResume.pdf";

//Instantiate the Document object

com.aspose.pdf.Document document = new com.aspose.pdf.Document(filePath);


//Create DocSaveOptions object

com.aspose.pdf.DocSaveOptions saveOptions = new com.aspose.pdf.DocSaveOptions();


//Set the recognition mode as Flow

saveOptions.setMode(com.aspose.pdf.DocSaveOptions.RecognitionMode.Flow);


saveOptions.setFormat(SaveFormat.DocX);

//Set the Horizontal proximity as 2.5

saveOptions.setRelativeHorizontalProximity(2.5f);


//Enable the value to recognize bullets during conversion process

saveOptions.setRecognizeBullets(true);


//Save the resultant DOC file

//document.save("/Users/ganesh-2007/Downloads/resumes/Jabi cv qatar_pdf.doc", saveOptions);

document.save("/Users/ganesh-2007/Downloads/resumes/AarthiShreyasResume_pdf.docx",saveOptions);

Dear Support.


I am trying to save PDF document to .DOCX using DocsSaveOptions. On save, document is empty.

I have attached code snippet used. Please suggest what is problem?

I have used aspose.pdf-10.6.2.jar and JDK7 libraries.

String filePath = "/Users/ganesh-2007/Downloads/resumes/AarthiShreyasResume.pdf";

//Instantiate the Document object

com.aspose.pdf.Document document = new com.aspose.pdf.Document(filePath);


//Create DocSaveOptions object

com.aspose.pdf.DocSaveOptions saveOptions = new com.aspose.pdf.DocSaveOptions();


//Set the recognition mode as Flow

saveOptions.setMode(com.aspose.pdf.DocSaveOptions.RecognitionMode.Flow);


saveOptions.setFormat(SaveFormat.DocX);

//Set the Horizontal proximity as 2.5

saveOptions.setRelativeHorizontalProximity(2.5f);


//Enable the value to recognize bullets during conversion process

saveOptions.setRecognizeBullets(true);


//Save the resultant DOC file

//document.save("/Users/ganesh-2007/Downloads/resumes/Jabi cv qatar_pdf.doc", saveOptions);

document.save("/Users/ganesh-2007/Downloads/resumes/AarthiShreyasResume_pdf.docx",saveOptions);

Hi Ganesh,


Thanks
for using our API’s.
<o:p></o:p>

I
have tested the scenario and I am able to notice the same problem. For the sake
of correction, I have logged this problem as PDFNEWJAVA-35157 in
our issue tracking system. We will further look into the details of this
problem and will keep you updated on the status of correction. Please be
patient and spare us little time. We are sorry for this inconvenience.

Hi Ganesh,


Thanks for your patience. We have further investigate the issue and found you need to use DocSaveOptions.DocFormat.DocX instead of com.aspose.pdf.SaveFormat.DocX, it will resolve the issue.

Please feel free to contact us for any further assistance.

Best Regards,.