Skip to content

Document loads should be sequential, they currently are not #5228

@fxchen

Description

@fxchen

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

  1. Open Document A
  2. Before Document A loads, Open Document B
  3. Document B appears on screen

Steps to Reproduce

  1. Load pdf.js viewer, which defaults to Document A (compressed.tracemonkey.pdf)
  2. Open Document B (see attached Hello World.pdf)
  3. Briefly, Docuemnt B appears
  4. Document A (compressed.tracemonkey.pdf) appears on top of the Document B

Example

A sample file & video loaded in pdf.js viewer:

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions