I am using IText pdf reader to read pdf file but for few of the pdf file I am getting "IndexOutOfBoundsException".
below is the code
com.itextpdf.text.pdf.PdfReader reader = new com.itextpdf.text.pdf.PdfReader(file.getPath());
Exception I am getting : java.lang.IndexOutOfBoundsException: Index -1 out of bounds for length 9854 but can able to open the pdf file with other applications.
I tried with stream as well but getting same error.
Suggest how I can fix the issue.
Upon all the try I found out the issue of getting exception. It is because of the iText API bug in its version 5.1 and when I rebuilt my application with the latest version 5.5.x.x I get no exception and every thing works fine :)
Getting Answer From: