Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Canvas deleted from page division when scroll #1133

Closed
dixit-atharva opened this issue Sep 13, 2024 · 8 comments
Closed

Canvas deleted from page division when scroll #1133

dixit-atharva opened this issue Sep 13, 2024 · 8 comments

Comments

@dixit-atharva
Copy link

When PDF has more then 10 pages and when i scroll down to page number 11 it blacks the first page canvas due to it lost the dropped item on canvas.

@dixit-atharva dixit-atharva changed the title Canvas blacnk issue Canvas deleted from page division when scroll Sep 13, 2024
@VadimDez
Copy link
Owner

I'm not sure I can reproduce your issue. Are you able to reproduce it here - https://vadimdez.github.io/ng2-pdf-viewer/ ?

@dixit-atharva
Copy link
Author

image
@VadimDez Please find uploaded image, try to upload PDF have more then 10 pages and scroll down slowly you will able to see first page canvas element is delete from it.

@VadimDez
Copy link
Owner

if you scroll back to the first page, can you see it?

@dixit-atharva
Copy link
Author

Yes when i get back to page 1 i can see it again, but issue is right away like i have placed division over pdf canvas that also delete from it.

@ftaffelt
Copy link
Contributor

Yes, this is the expected behaviour from PDFJS and so also from ng2-pdf-viewer. PDFJS renders only the visible pages, which are in the viewport plus some pages before and after this pages in the viewport. Pages which are not more in the visible range are "offloaded", meaning their canvas are removed from the DOM, to reduce memory footprint. If this page becomes visible again, the canvas will be readded to the DOM. Maybe your expaction from the option "Show all pages" is leading in the wrong way?

@dixit-atharva
Copy link
Author

dixit-atharva commented Sep 19, 2024

Yeah i think so, is there any way i can stop the offload or it or can set the visible pages range ?

@ftaffelt
Copy link
Contributor

ftaffelt commented Sep 20, 2024

Not that i know, as this is deeply baked into PDFJS.

@shamoon
Copy link
Contributor

shamoon commented Oct 21, 2024

Should be closed as above

also #1120

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants