Closed peteris-zealid closed 1 year ago
Interesting. I think I'm OK with calling this a bug. The spec says that missing references are to be processed the same way as nulls, and that nulls in dictionaries are to be processed the same way as missing elements, so at least in nonstrict mode this should work. Will take a look soon.
In the meantime, can you share a sample file or at least share the iText version that last touched your file? If it's a recent one, I'll see if I can poke one of my former colleagues to get it fixed in a future release. ;)
(Having said that, the recent iText 8 release apparently refactors a bunch of form handling code, so there's a decent chance that the underlying bug got fixed en passant.)
Sadly I cannot share the pdf. There is a good chance that they have fixed it already because the particular pdf was created with iText5 I think.
Consider this issue in stackoverflow https://stackoverflow.com/questions/22909979/itextsharp-acrofields-are-empty
So there are pdfs created with iText that have root object that look like this
where the object with id 123456 does not exist.
In this case pyhanko will not create an incremental update by creating the non-existent object, but raise an exception.
These are the lines in question.