-
Hello everyone, I have a question about optimizing the preview of a PDF file over 100MB in my application. It’s a linearized PDF, and as I understand, PDF.js should allow range requests (partial downloads). You can see an example of this in Mozilla's viewer, where the partial requests (status 206) are flowing in: This works as expected in the Mozilla example, but I haven't been able to achieve the same behavior using this library. My PDFs are hosted on S3, which supports range requests, and I’m using the following code to load the PDF:
From what I understand, this code should automatically support range downloads if the PDF is linearized, but it doesn’t seem to work. The first page doesn’t render until the entire PDF is downloaded. I also tried adding a manual Range header:
but the issue persists. Could someone guide me on how to resolve or improve this? Thanks in advance for any suggestions! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
For anyone else who has a similar problem, I had the S3 configuration wrong. This configuration helped me solve the problem. |
Beta Was this translation helpful? Give feedback.
For anyone else who has a similar problem, I had the S3 configuration wrong.
This configuration helped me solve the problem.
#1691 (comment)