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

pdf.worker.js:2311 Error: inconsistent generation in XRef #7496

Closed
banguero opened this issue Jul 18, 2016 · 1 comment
Closed

pdf.worker.js:2311 Error: inconsistent generation in XRef #7496

banguero opened this issue Jul 18, 2016 · 1 comment

Comments

@banguero
Copy link

Link to PDF file (or attach file here):
repro-pdf.pdf

Configuration:

  • Web browser and its version:
    Chrome
  • Operating system and its version:
    Win 10
  • PDF.js version:
    var pdfjsVersion = '1.5.341';
  • Is an extension:

Steps to reproduce the problem:

  1. Go to https://mozilla.github.io/pdf.js/web/viewer.html
  2. Upload the pdf attached
  3. Notice the pdf fails to open, and you see this errors in the console:

pdf.worker.js:2311 Error: inconsistent generation in XRef
pdf.worker.js:2312 at error (https://mozilla.github.io/pdf.js/build/pdf.worker.js:2312:17)
at Object.XRef_fetchUncompressed as fetchUncompressed
at Object.XRef_fetch as fetch
at tryFetch (https://mozilla.github.io/pdf.js/build/pdf.worker.js:35576:24)
at Object.XRef_fetchAsync as fetchAsync
at next (https://mozilla.github.io/pdf.js/build/pdf.worker.js:34829:18)
at https://mozilla.github.io/pdf.js/build/pdf.worker.js:34840:15
undefined:1 Uncaught (in promise) Error: inconsistent generation in XRef
undefined:1 Uncaught (in promise) Error: inconsistent generation in XRef
undefined:1 Uncaught (in promise) Error: inconsistent generation in XRef
viewer.js:8122 PDF 6a7dfaf179fa629ad1e3ba43e4159de3 [1.5 Acrobat Distiller 5.0.5 (Windows) / -](PDF.js: 1.5.341)

What is the expected behavior? (add screenshot)
pdf opens correctly like in a native viewer

What went wrong? (add screenshot)
nothing shows up

Link to a viewer (if hosted on a site other than mozilla.github.io/pdf.js or as Firefox/Chrome extension):

@OmarShehata
Copy link

Does this file open correctly for you in other PDF viewers? It seems like there's something wrong with it. Adobe Acrobat Reader will open it after saying "There was a problem reading this document" for me. Just dragging the file into chrome gives me a glitched out looking first page (http://puu.sh/qcnUM/30d478bde6.jpg).

I don't know enough about PDF, but after some digging, it seems like this section here in the XRef Table is the problem (around line 18636 when I open in Sublime):

xref
5 1
0001983134 00000 n
1998 5
0001983597 00000 n
0001983639 00000 n
0001989260 00000 n
0001997411 00000 n
0002001409 00000 n
trailer

pdfjs is crashing because the generation number (1) in the line 5 1 doesn't match the one in the line below that (0). That's as much as I could ascertain.

Does anyone know if this is something the libary should be able to handle? Or is throwing a fatal error for this the correct behavior?

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