mozilla / pdf.js

PDF Reader in JavaScript
https://mozilla.github.io/pdf.js/
Apache License 2.0
48.8k stars 10.03k forks source link

PDFJS stuck on rendering #8610

Closed mntan closed 7 years ago

mntan commented 7 years ago

Hi guys,

I've tested opening a file through the PDFView at the browser console via code line:

PDFView.open(path, 0.5);

The result:

The content of file didn't appear on the production site, but on the local environment setup the content of file has appeared.

Then I resize my browser or execute the code line PDFViewerApplication.pdfViewer.update() in the browser console, the content of file has appeared in the production environment.


Some questions:

  1. I'm wondering could I have an advice to address the problem above?

  2. As I know if the content of a file is rendered, the event pagerendered will be fired. And We can base on it to do many other logics behind it. I'm wondering, when does the event pagerendered not fired? Which scenarios can cause this problem if that happens?

    Some more detail:

    • PDF.js version has been set up: v1.1.469
    • Web browser for testing: Chrome version 59.0.3071.115
    • Some log in the browser console from the production site that I have added for debug:
      getDocumentProgress Object {loaded: 3867, total: 214058} 0.01806519728297938
      viewer.js:532 getDocumentProgress Object {loaded: 12288, total: 214058} 0.057405002382531836
      viewer.js:532 getDocumentProgress Object {loaded: 36864, total: 214058} 0.17221500714759552
      viewer.js:532 getDocumentProgress Object {loaded: 57344, total: 214058} 0.26789001111848193
      viewer.js:532 getDocumentProgress Object {loaded: 65536, total: 214058} 0.30616001270683646
      viewer.js:532 getDocumentProgress Object {loaded: 65536, total: 214058} 0.30616001270683646
      viewer.js:532 getDocumentProgress Object {loaded: 69397, total: 214058} 0.32419718020349625
      viewer.js:532 getDocumentProgress Object {loaded: 82986, total: 214058} 0.3876799745863271
      viewer.js:532 getDocumentProgress Object {loaded: 131072, total: 214058} 0.6123200254136729
      viewer.js:539 load pdfDocument PDFDocumentProxy {pdfInfo: Object, transport: WorkerTransport} 0.5
      pdf_viewer.js:234 setDocument is running PDFDocumentProxy {pdfInfo: Object, transport: WorkerTransport}
      pdf_viewer.js:286 firstPagePromise PDFPageProxy {pageIndex: 0, pageInfo: Object, transport: WorkerTransport, stats: StatTimer, commonObjs: PDFObjects…}
      pdf_viewer.js:303 bindOnAfterAndBeforeDraw PDFPageView {id: 1, renderingId: "page1", rotation: 0, scale: 0.5, viewport: PageViewport…}
      pdf_viewer.js:339 setDocument initCustomEvent pagesinit CustomEvent {isTrusted: false, detail: null, type: "pagesinit", target: div#viewerContainer, currentTarget: null…}
      pdf_viewer.js:340 setDocument defaultRenderingQueue update false
      viewer.js:815 setInitialView for pagerendered page=1&zoom=50,-15,-226 0.5
      viewer.js:975 setInitialView detail null page=1&zoom=50,-15,-226
      viewer.js:976 setInitialView detail storedHash page=1&zoom=50,-15,-226
      viewer.js:904 PDF 7f29e3f3faae5fd28e66fcc9e36fc8eb [1.4 OpenPDF 1.0.0-SNAPSHOT / -] (PDF.js: -)
      viewer.js:532 getDocumentProgress Object {loaded: 134934, total: 214058} 0.630361864541386
      viewer.js:532 getDocumentProgress Object {loaded: 172032, total: 214058} 0.8036700333554457
      viewer.js:532 getDocumentProgress Object {loaded: 196608, total: 214058} 0.9184800381205094
      viewer.js:532 getDocumentProgress Object {loaded: 196608, total: 214058} 0.9184800381205094
      viewer.js:532 getDocumentProgress Object {loaded: 200469, total: 214058} 0.9365172056171692
      viewer.js:532 getDocumentProgress Object {loaded: 249856, total: 214058} 1.167235048444814
      viewer.js:532 getDocumentProgress Object {loaded: 262144, total: 214058} 1.2246400508273458
      viewer.js:532 getDocumentProgress Object {loaded: 262144, total: 214058} 1.2246400508273458
      viewer.js:779 createEvent documentload CustomEvent {isTrusted: false, detail: Object, type: "documentload", target: null, currentTarget: null…}

      As In the log in the browser console that I have seen some these things: {loaded: 3867, total: 214058} 0.01806519728297938, ...,{loaded: 262144, total: 214058} 1.2246400508273458 but I think that is no matter with the problem on opening a file.

Snuffleupagus commented 7 years ago

PDF.js version has been set up: v1.1.469

First of all, that version is almost two years old. Please update to the latest release, see https://github.com/mozilla/pdf.js/releases, and check if the issue still exists.

I'm wondering could I have an advice to address the problem above?

Since this appears to be a custom deployment of PDF.js, as asked for in both ISSUE_TEMPLATE.md and CONTRIBUTING.md, please provide access to a working example since otherwise we cannot help.

timvandermeij commented 7 years ago

Closing since the issue is incomplete. Provide the information requested above to reopen.