How to enable range requests on the WebViewer? Right now the viewer waits for the whole file to download

PDF.js Express Version 1.7

Detailed description of issue
I’ve read through the documentation and API and I can see PDF.JS Express supports range requests for a smoother loading and viewing UX. But I’m having a hard time figuring out how to make this work/enable it.

Our files are all in S3 and I’ve already run some tests and confirmed that they all support range requests. But when I load documents with the loadDocument() method, it’s not doing range requests, and is rather doing one large request for the whole file and waiting for it to download before rendering.

Checking on the Network tab of Chrome’s Developer Tools, I see the file is requested only once, with a 200 OK response at the end. I should be seeing many requests as I scroll through a PDF, each returning a 206 response, right?

Lookin forward to help with this. Thank you.

Hey there!

This is a known issue that we haven’t had a chance to look at yet. We hope to investigate this very soon and push a fix ASAP.

I am going to close this as it is a duplicate of Is it possible to partial rendering of pdf file? - #7 by Logan. Keep an eye on that thread for updates!

Thanks,
Logan

1 Like