You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Instant Display of Large PDF Files: Modifying pdf-js Components for Background Downloading #312
I have PDF files exceeding 200MB, and pdf-js requires downloading the entire file before displaying the first page, which is time-consuming. How can I modify components/app/pdf to instantly display the page while simultaneously downloading the file in the background?
Hi @rocheston, thanks for the question. This will be tricky for a few reasons, one of them being that the PDF app is not very efficient when loading large PDF's currently, even once it has the entire file local. I had planned at some point to add lazy loading to how it loads the pages because as it is now it can get quite slow when it's many pages. As for loading in the background or via streaming, that is another complexity as I am not sure if PDF's can be loaded intermittently, and if they can I imagine it would be something pdf.js would need to support. I don't know enough about PDF's to even say what a "linearized" means in the context of being able to load it this way. I will add this as a feature request and in the mean time if you find anything in the pdf.js docs/repo about how to do this please post it here and I can give further advice on how to integrate the feature.
Repository owner locked and limited conversation to collaborators on May 29, 2023
Activity
DustinBrett commentedon May 29, 2023
Hi @rocheston, thanks for the question. This will be tricky for a few reasons, one of them being that the PDF app is not very efficient when loading large PDF's currently, even once it has the entire file local. I had planned at some point to add lazy loading to how it loads the pages because as it is now it can get quite slow when it's many pages. As for loading in the background or via streaming, that is another complexity as I am not sure if PDF's can be loaded intermittently, and if they can I imagine it would be something pdf.js would need to support. I don't know enough about PDF's to even say what a "linearized" means in the context of being able to load it this way. I will add this as a feature request and in the mean time if you find anything in the pdf.js docs/repo about how to do this please post it here and I can give further advice on how to integrate the feature.