-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Closed
Description
Hello
I was wondering if PDF.js has a way to cancel or reject already created promises. We have documents that do not seem to load sequentially in the viewer.
Expected Behavior
- Open Document A
- Before Document A loads, Open Document B
- Document B appears on screen
Steps to Reproduce
- Load pdf.js viewer, which defaults to Document A (compressed.tracemonkey.pdf)
- Open Document B (see attached Hello World.pdf)
- Briefly, Docuemnt B appears
- Document A (compressed.tracemonkey.pdf) appears on top of the Document B
Example
A sample file & video loaded in pdf.js viewer:
- HelloWorld.pdf: http://cl.ly/0i2N250G3z2I
- HelloWorld.m4v: http://cl.ly/3w0g1r2l2v3r
Investigation
In viewer.js:
- The 'Open' event seems to overwrite the PDFView by calling close on the prior document. The prior document's promises are not canceled
- In the example, Document B's load event seems to finish before the first Document A's load event does, and Document A's load / render promises overwrite the canvas
Reactions are currently unavailable