mozilla / pdf.js

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

Progressive View large PDF files in PDF.JS #6104

Closed sujit-baniya closed 9 years ago

sujit-baniya commented 9 years ago

Sir, We are using PDF.JS in our daily newspaper to view PDF files online. Our PDF files are of maximum size 20MB. While we try to access the pdf using PDF.JS, the complete PDF file is downloaded to client before rendering the page. This is creating a performance issue in website to render the file. Is there some configuration which we can apply so that the readers can view pages before complete download. Here is the reference of the website where we are using PDF.JS. <http://epaper.ekantipurapp.com/the-kathmandu-post/view Any help and support would be highly appreciated.

Thank you!

Rob--W commented 9 years ago

That domain name does not exist. Please update your post with a working link to a PDF. Even if I remove "app" to get http://epaper.ekantipur.com/the-kathmandu-post/view, the page shows "Epaper you requested couldn't be found. The adress might have been changed. Please try browsing our epaper from the links below."

sujit-baniya commented 9 years ago

Sorry for misleading information. My boss told me that the link was only accessible in-house. But the pages of pdf are only rendered after complete download. Any help would be heighly appreciated. Thank you!

Rob--W commented 9 years ago

It's not possible to help if you don't share any information about your setup.

If PDFs are only displayed after the whole file is loaded, then check:

  1. Whether the PDF file is linearized / "web-optimized".
  2. Whether the server supports range requests.
sujit-baniya commented 9 years ago

Ok Sir! Thank you for the suggestion. I'll try and get back to you.

sujit-baniya commented 9 years ago

Sir! I'd made the PDF file linearized/"Web Optimized", but still the loading time is high for 13MB of pdf file. Is there other way round in which I can render the pdf page while downloading the file like Lazy Load?

Rob--W commented 9 years ago

@itsursujit See 2 of my previous comment, about Range requests. And again, I cannot help you any further if you don't provide access to your website.

timvandermeij commented 9 years ago

Closing as answered for now. Linearization and range requests are the best suggestions we can give given the limited amount of information provided.