Turn generation mismatch from error into warning
There are documents out there where object generation was incremented on save, but some indirect references to it were not updated accordingly. Currently poppler requires a strict match of both object number and generation number when fetching an object, and therefore fails to load objects with mentioned inconsistencies.
This weakens the match criterion in XRef::fetch
for uncompressed objects to consider only num
, and take whatever generation is in XRef. We keep the gen
parameter because it's still useful to generate a warning on mismatch.
Fixes #837 (closed).
To be honest, I'm not sure whether or not it's good to be tolerant in this case. We can see different approaches out there:
- mupdf ignores generation and fetches what's there. They don't even warn on mismatch.
-
PDF.js is strict, they throw an
Inconsistent generation in XRef
error.
May the jury (@aacid @adamreichold @sander) judge :)