I am using version 5.4.4 and I have a problem with the com.itextpdf.text.pdf.PdfReader.
When I read a PDF with
PdfReader reader = new PdfReader(„Test.pdf");
- its’s a scanned sheet and I can open it with Adobe Reader - following error occures:
com.lowagie.text.exceptions.InvalidPdfException: Rebuild failed: Dictionary key endstream is not a name. at file pointer 3913220; Original message: Dictionary key endstream is not a name. at file pointer 3913220
at com.lowagie.text.pdf.PdfReader.readPdf(PdfReader.java:668)
at com.lowagie.text.pdf.PdfReader.(PdfReader.java:189)
at com.lowagie.text.pdf.PdfReader.(PdfReader.java:264)
at com.lowagie.text.pdf.PdfReader.(PdfReader.java:247)
I look in the code and since itext 5.4.4 an exception is thrown. In older versions, this exception is ignored.
Code from method readDocObj() in itext 5.4.3 on line 1319:
catch (Exception e) {
obj = null; // Exception ignored !!!!!!!!
}
Code from method readDocObj() in itext 5.4.4 on line 1319:
catch (IOException e) {
if (debugmode) {
e.printStackTrace();
obj = null;
}
else
throw e; // Exception thrown !!!!!!
}
In the newest itext-Version 5.5.1 on line 1346:
catch (IOException e) {
if (debugmode) {
if (LOGGER.isLogging(Level.ERROR))
LOGGER.error(e.getMessage(), e);
obj = null;
}
else
throw e; // Exception thrown !!!!!!
}