DanielArnould / react-pdf-highlighter-extended

📄 Set of modern React components for PDF highlighting
https://danielarnould.github.io/react-pdf-highlighter-extended/example-app/
MIT License
43 stars 16 forks source link

pdf load 2 times #2

Closed mehranml closed 6 months ago

mehranml commented 7 months ago

after loading pdf we have 2 loaded pdf for example for 22 page pdf we have 44 page

DanielArnould commented 7 months ago

Could you elaborate more on this or provide some steps to reproduce this issue? Do you mean the page count for the pdf is doubled? Does the viewer display 2 stacked documents (i.e., after page 22, does it show page 1 again)? Does the document load just trigger twice? I'm just having a little trouble understanding what you're referring to exactly 😕.

HenrikMader commented 7 months ago

Also the same here. The viewer displays 2 stacked documents.

mehranml commented 7 months ago

Yes it's 2 stack after page 22 page 1 shows again

DanielArnould commented 6 months ago

The default PDF.js viewer appears to not handle immediate subsequent document loads, keeping pages in the initial rendering queue. I suspect you are either running your application in strict mode or changing documents very frequently. I've just fixed this by debouncing the viewer initialisation, but I hope I'm missing a better fix.

This is potentially related to https://github.com/mozilla/pdf.js/issues/10018 .

The fix will be released in version 7.1.0