-
Notifications
You must be signed in to change notification settings - Fork 632
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
Root object is missing or invalid #135
Comments
Are you still highly doubtful that this is a viable fix? Why should it be accepted then? |
For science and progress, here is how an AGPL project chose to solve this: https://github.com/itext/itextpdf/blob/develop/itext/src/main/java/com/itextpdf/text/pdf/PdfStamperImp.java#L487 |
Just wondering, if we should close this issue, as there is no example code to reproduce the error. Also without example code we can't check if this is still an issue. |
Closing this issue, as there is no example PDF to investigate it. Also seems to be a problem of a particular PDF. |
Considering Andreas' comment he appears to have had an idea what the issue was about. |
There seems to be a bug with recompiling some pdfs: after just using PdfReader and writing with PdfStamper, opening the resulting output in Adobe reader outputs "There was an error opening this document. The root object is missing or invalid."
Checking the resulting file, the root object was referencing a non-existent object in the pdf. Checked and it might be because the original pdf had three Catalog objects, while the resulting pdf had one only, and it was referenced by the Info object.
My initial fix was to check that if the Info object was a Catalog type, the Root object would be referencing it; this fix worked, but I am not so sure since I am very inexperienced with pdf manipulation. Here is the pull request but highly doubtful that it is a viable fix.
Some notes:
The text was updated successfully, but these errors were encountered: