Hi,
I am trying to convert a PDF to word using “EnhancedFlow” and it works for most PDF except a few ones that error with:
java.lang.NullPointerException: Cannot read field “lj” because the return value of “com.aspose.pdf.internal.l101if.lI.lj(int)” is null
I am using Apose 24.9
And here is a code snipped
Document doc = new Document( dataDir + "input.pdf");
DocSaveOptions saveOptions = new DocSaveOptions();
saveOptions.setFormat(DocSaveOptions.DocFormat.DocX);
saveOptions.setMode(RecognitionMode.EnhancedFlow);
doc.save( dataDir + "output.docx", saveOptions);
Note that using “Flow” works but then it is not what I am looking for as I am loosing some formatting
Attached in a sample sanitized file that fails with the error above.
Thanks
Aspose_Support_2.pdf (33.4 KB)