I’m trying to convert a file from a .pdf to .doc format, i’m using the library Aspose PDF 18.9.1 with temporany license and Java 8. The PDF is of 42 MB with few pictures and few tables, I’m getting this error after 45 minutes of processing, the document has 1500 pages:
java.lang.StackOverflowError at com.aspose.pdf.internal.l212I.I6l.l0I(Unknown Source) at com.aspose.pdf.internal.l212I.I6l.lif(Unknown Source) at com.aspose.pdf.internal.l2127.I1.ll(Unknown Source) at com.aspose.pdf.internal.l212I.I7.lif(Unknown Source) at com.aspose.pdf.internal.l2127.I1.ll(Unknown Source) at com.aspose.pdf.internal.l212I.I6l.lif(Unknown Source) ...
I have got the OutOfMemory that I have solved increasing the heap space to 2048 MB, what could I try ?
This is the code :
Document pdfDocument = new Document(pdf); // Create DocSaveOptions object DocSaveOptions saveOption = new DocSaveOptions(); // Set format DOC saveOption.setFormat(DocSaveOptions.DocFormat.Doc); // Set the recognition mode as Flow saveOption.setMode(DocSaveOptions.RecognitionMode.Flow); // Enable the value to recognize bullets during conversion process saveOption.setRecognizeBullets(true); // Create OutputStream OutputStream fos = new FileOutputStream(pathDOC); // Save the resultant DOC file pdfDocument.save(pathDOC, saveOption);
Where pathDoc is the String variable path to save the doc.
This is the file: drive.google.com/open?id=18XU_058OHcOfWY68NnpNDjBGa95OHbeO