pdfjs icon indicating copy to clipboard operation
pdfjs copied to clipboard

XREF points to the wrong object

Open rkusa opened this issue 4 years ago • 0 comments

There are apparently quite a few PDFs out there with a syntax error similar to:

1.0 : Syntax error, XREF for 11:0 points to wrong object: 10:0

This basically means that the XREF, which is basically a dictionary of all PDFs object and their byte offset in the document, contains a wrong offset. The offset either points to an object with the wrong ID, or to a point in the document that is not the beginning of an object at all.

Quoting myself from another issue:

While most PDF readers seem to notice and fix the xref pointing to the wrong object, I never planed to make pdfjs that permissive towards PDF syntax errors. So I am afraid that I am not investing time in this case myself, sorry. I might consider accepting a PR though if the fix isn't too invasive in comparison to the fact that this is a PDF syntax error. If it ends up coming up very often, I might change my mind and look into it myself. However, until now, my deployment of pdfjs never encountered that syntax error before - but merging PDFs is also not my main use-case.

I've created this issue to keep track of all related issues, which are currently:

  • https://github.com/rkusa/pdfjs/issues/211
  • https://github.com/rkusa/pdfjs/issues/214
  • https://github.com/rkusa/pdfjs/issues/217

rkusa avatar Jun 30 '20 14:06 rkusa