mozilla / pdf.js

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

[performance]: The putBinaryImageData function takes too long and blocks page interaction. #18088

Open lu606 opened 2 months ago

lu606 commented 2 months ago

Attach (recommended) or Link to PDF file here: example.pdf

Configuration:

Steps to reproduce the problem:

  1. Render a 30+ page PDF document in a 200 × 200 container
  2. After calling the pdfPage rendering function, the page becomes unresponsive.

What is the expected behavior? Render normally without blocking user behavior

What went wrong? (add screenshot) image image

Snuffleupagus commented 2 months ago

PDF.js version: 3.4.120

That version is no longer supported, please find the latest releases at https://mozilla.github.io/pdf.js/getting_started/#download

calixteman commented 2 months ago

I can reproduce the issue with Firefox nightly and I think I've a fix.

lu606 commented 2 months ago

I can reproduce the issue with Firefox nightly and I think I've a fix.

This sounds like good news, which version should I upgrade to and give it a try? Is it the latest stable version?

lu606 commented 2 months ago

I found another problem. If the canvas finishes drawing the image, I open multiple browser tabs. After operating for a period of time (about 5 minutes), if you switch back to the tab with canvas, the content will be cleared...