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

Root object is missing or invalid #135

Open
tekurusu opened this issue Jan 15, 2019 · 5 comments
Open

Root object is missing or invalid #135

tekurusu opened this issue Jan 15, 2019 · 5 comments

Comments

@tekurusu
Copy link

tekurusu commented Jan 15, 2019

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 file was generated via Panasonic Image Capture Plus.
  • Using append mode for the stamper also fixes the issue, but looking for other alternatives.
@andreasrosdal
Copy link
Contributor

but highly doubtful that it is a viable fix.

Are you still highly doubtful that this is a viable fix? Why should it be accepted then?

@andreasrosdal
Copy link
Contributor

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

@asturio
Copy link
Member

asturio commented Feb 23, 2024

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.

@asturio
Copy link
Member

asturio commented Apr 25, 2024

Closing this issue, as there is no example PDF to investigate it. Also seems to be a problem of a particular PDF.

@asturio asturio closed this as not planned Won't fix, can't repro, duplicate, stale Apr 25, 2024
@mkl-public
Copy link
Contributor

Considering Andreas' comment he appears to have had an idea what the issue was about.

@asturio asturio reopened this Apr 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants