Skip to content
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

RUPS hangs "Reading the Cross-Reference table 3%" of FoxHexOne Mutation file1114.pdf #36

Open
petervwyatt opened this issue Dec 8, 2022 · 3 comments

Comments

@petervwyatt
Copy link

iText RUPS 7.2.4 hangs while attempting to open FoxHexOne Mutation file1114.pdf (see https://github.com/pdf-association/pdf-corpora#foxhex0ne-mutations). There is no output in the console, Debug Info or any other pane. Yes, this is somehow a bad file, but I was hoping to find out why.

image

@Eswcvlad
Copy link
Contributor

Eswcvlad commented Apr 3, 2025

Do you happen to still have these PDF files lying around somewhere? The site is now dead and Internet Archive didn't store the PDFs themselves...

@petervwyatt
Copy link
Author

petervwyatt commented Apr 4, 2025

Sorry to say it still causes an exception with the new 25.03 release...

file1114.pdf

I get a crash dialog (using EXE) and this:

ERROR - Cannot invoke "com.itextpdf.rups.model.TreeNodeFactory.expandNode(com.itextpdf.rups.view.itext.treenodes.PdfObjectTreeNode)" because the return value of "com.itextpdf.rups.model.ObjectLoader.getNodes()" is null

@Eswcvlad
Copy link
Contributor

Eswcvlad commented Apr 4, 2025

Hmm. So before it was just hanging without errors.

Now it throws an error, but there is an issue in ObjectLoader, that the exception in the loading itself gets ignored. But since init fails, null is propagated further and gives us the current error.

The actual error is coming from the tokenizer in iText:

com.itextpdf.io.exceptions.IOException: Error at file pointer 101,117.
	at com.itextpdf.io.source.PdfTokenizer.throwError(PdfTokenizer.java:734)
	at com.itextpdf.kernel.pdf.PdfReader.readDictionary(PdfReader.java:979)
	at com.itextpdf.kernel.pdf.PdfReader.readObject(PdfReader.java:896)
	at com.itextpdf.kernel.pdf.PdfReader.readObject(PdfReader.java:847)
	at com.itextpdf.kernel.pdf.PdfReader.readObject(PdfReader.java:1493)
	at com.itextpdf.kernel.pdf.PdfReader.readObject(PdfReader.java:1497)
	at com.itextpdf.kernel.pdf.PdfReader.readObject(PdfReader.java:843)
	at com.itextpdf.kernel.pdf.PdfIndirectReference.getRefersTo(PdfIndirectReference.java:109)
	at com.itextpdf.kernel.pdf.PdfIndirectReference.getRefersTo(PdfIndirectReference.java:113)
	at com.itextpdf.kernel.pdf.PdfIndirectReference.getRefersTo(PdfIndirectReference.java:93)
	at com.itextpdf.kernel.pdf.PdfDocument.getPdfObject(PdfDocument.java:452)
	at com.itextpdf.rups.model.IndirectObjectFactory.storeNextObject(IndirectObjectFactory.java:139)
	at com.itextpdf.rups.model.ObjectLoader.doInBackground(ObjectLoader.java:140)
	at com.itextpdf.rups.model.ObjectLoader.doInBackground(ObjectLoader.java:56)
	at java.desktop/javax.swing.SwingWorker$1.call(SwingWorker.java:304)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.desktop/javax.swing.SwingWorker.run(SwingWorker.java:343)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: com.itextpdf.io.exceptions.IOException: Dictionary key R is not a name.
	... 20 more

So it trips over this part:
Image

As in it parses the dictionary key-value pair as /Parent#01#FBC#E3 0, which seems correct in this case, and then encounters R, which is not a name, so it bails.

Overall, it looks like correct behavior from iText, though a bit disappointing, that it prevents looking at other stuff in the document in RUPS.

But we definitely need to fix the error message in RUPS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants