webodf / ViewerJS

ViewerJS: Document Reader in JavaScript
http://viewerjs.org
1.94k stars 421 forks source link

Viewer only loaded two first pages #125

Closed fellipefingoli closed 9 years ago

fellipefingoli commented 9 years ago

I've a probleme while using Viewer JS. My PDF file only load the first two pages, the others simply doesn't show. The page numbers are correct but the scroll bar and the page changes buttons only show two pages. Sometimes the viewer is stuck on a random page. I get this error on console : Uncaught TypeError: Cannot read property 'resolve' of null in line 25 in line 2531.

kossebau commented 9 years ago

Hi. Which version of the PDF plugin are you using? See the about dialog when clicking on the "ViewerJS" button. And is your PDF somehow accessible, so we could check ourselves? Or could you send it to friedrich@kogmbh.com at least?

fellipefingoli commented 9 years ago

Hi. Thank you for response. The version is: Using the PDF.js (v1.0.907) plugin to show you this document. I already update the PDF.js plugin to the last stable version and I got the same error. Unfortunately the pdf is private but I will see what I can do about send you a PDF with this error.

fellipefingoli commented 9 years ago

Ok, I've an authorization for share the file with you. Just to ilustrate better, when I used the vanilla viewer like this http://mozilla.github.io/pdf.js/examples/learning/prevnext.html, I got no error.

kossebau commented 9 years ago

Thanks, received. Will investigate tomorrow morning. If it works in the vanilla viewer, that indeed seems like that is something that can be fixed in ViewerJS.

kossebau commented 9 years ago

(Pardon, only found time to look into the issue today) Seems the problem is that some code parts of ViewerJS assume constant page sizes, which your PDF does not have. :no_good: Currently seeing if that assumptions can be removed without cutting too many strings, not sure yet.

kossebau commented 9 years ago

Should be fixed with latest ViewerJS 0.5.6 of today, so closing this issue now. Please get the latest version from viewerjs.org, and reopen if there still is a problem.