Free Support Forum - aspose.com

Java PDF to Word | Convert PDF to DOC or PDF to DOCX in Java

Hi Support Team,

I tried to use PDF product family in Android Platform but unfortunately getting error in following conversation:

  1. PDF to Docx - Specified argument was out of the range of valid values.
  2. PDF to PPT
  3. PDF to ePub
    I follow below url :
    https://blog.aspose.com/2020/01/17/convert-pdf-to-word-doc-docx-in-java/

Platform : Android
Lib : Latest 20.8 Android dependency

Can you please help me to solved out this problem.

Thanks,

@PDFReader

Would you please share your sample PDF document with us so that we can test the scenario in our environment and address it accordingly.

Hi,
I am not able to convert PDF to Doc.

PFA sample PDF file.

Thanks,pdf.pdf (423.8 KB)

@PDFReader

We have tested the scenario in our environment with Aspose.PDF for Java 20.9 and were unable to notice any issue. The PDF file was converted into DOCX without throwing any exception. We used following code snippet:

Document doc = new Document(dataDir + "pdf.pdf");
DocSaveOptions saveOption = new DocSaveOptions();
saveOption.setMode(DocSaveOptions.RecognitionMode.Flow);
saveOption.setFormat(DocSaveOptions.DocFormat.DocX);
saveOption.setRecognizeBullets(true);
doc.save(dataDir + "sample20.9.docx", saveOption);

sample20.9.zip (447.5 KB)

Would you please try with the latest version of the API and in case you still face any issue, please let us know.