-
Notifications
You must be signed in to change notification settings - Fork 599
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ArrayIndexOutOfBoundsException when opening PDF file with invalid indirect reference #718
Comments
We have also starting to get reports of this and can see the same stacktrace showing up since about 1-2 weeks ago and according to the report it is for PDF:s with version 1.7 and only for those produced by:
Unfortunately, I can also not share any documents. |
My PDF was created with Microsoft PowerPoint 2019 three weeks ago (2022-04-07). But as it was the first time that such an error was reported and as we have enough other documents that were created by Microsoft PowerPoint 2019 before, one could guess that a Microsoft update is responsible for the broken PDFs (and one could hope, that Microsoft will fix that soon, too). |
I get the same problem. I hope that the pull request for this bug can be accepted. java.lang.IndexOutOfBoundsException: Index -1 out of bounds for length 7770 |
I have a (confidential) PDF file, which can be opened by Acrobat Reader, Chrome and Firefox, but throws the following exception when opened with OpenPDF:
Apparently an indirect reference in the PDF references a -1 (which is not valid according to the standard, but is ignored by most readers). I debugged the PDF and there is indeed a "-1 0 R" in one of the dictionary arrays, so no error in the
PRTokeniser
.iText has fixed that a while ago, see here:
https://stackoverflow.com/questions/16699709/itext-throws-java-lang-arrayindexoutofboundsexception-on-creation-of-pdfreader
To Reproduce
Unfortunately I can't provide the PDF file here.
Expected behavior
Either throw an InvalidPdfException or (IMHO better) silently drop the invalid and unused reference.
Version
The text was updated successfully, but these errors were encountered: