which produces “java.lang.ArrayIndexOutOfBoundsException: 1685 at com.aspose.pdf.ParagraphAbsorber.lf(Unknown Source)” error.
How can we solve this problem?
temp–(3d-pdf).pdf (448.8 KB)
com.aspose.pdf.License license = new com.aspose.pdf.License();
license.setLicense(“src/main/resources/license-office”);
Document pdfDoc= new Document(filePath+“temp–(3d-pdf).pdf”);
PageCollection pages=pdfDoc.getPages();
System. out .println(pages.size());
for ( int i=1;i<=pages.size();i++) {
Page page=pages.get_Item(i);
System. out .println(i);
System. out .println(page);
ParagraphAbsorber absorber = new ParagraphAbsorber();
absorber.visit(page);
List<PageMarkup> sList = absorber.getPageMarkups();
for (PageMarkup pMarkup:sList) {
List<MarkupSection> secs = pMarkup.getSections();
for (MarkupSection mse:secs) {
List<MarkupParagraph> paList=mse.getParagraphs();
for (MarkupParagraph mPa:paList) {
List<TextFragment> fraList=mPa.getFragments();
for (TextFragment tf:fraList) {
System. out .println(tf.getText());
System. out .println("######################");
}
}
}
}
System. out .println("*****************************");
}