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

first request of range request download whole pdf file? #11161

Closed
yuweiming2016 opened this issue Sep 19, 2019 · 2 comments
Closed

first request of range request download whole pdf file? #11161

yuweiming2016 opened this issue Sep 19, 2019 · 2 comments

Comments

@yuweiming2016
Copy link

yuweiming2016 commented Sep 19, 2019

Configuration:

  • Web browser and its version: chrome 75
  • Operating system and its version: centos7.3
  • PDF.js version: 2.1.266
  • Is a browser extension: no

I opened the pdf.js demo with chrome and I found that the range request was in effect, but why did the first request download the whole pdf file?
image

What is the expected behavior? (add screenshot)
i expect result as follow:
image

Am I missing something?

http://mozilla.github.io/pdf.js/web/viewer.html

@Snuffleupagus
Copy link
Collaborator

This is the expected result of PR #8768, which was needed to address issue #5319. Although it's not recommended to disable streaming for performance reasons, it can be done using the following option:

pdf.js/src/display/api.js

Lines 189 to 191 in 7af66c8

* @property {boolean} disableStream - (optional) Disable streaming of PDF file
* data. By default PDF.js attempts to load PDFs in chunks.
* The default value is `false`.

@yuweiming2016
Copy link
Author

@Snuffleupagus, thank you for you answer! it work for me now. may i ask why there is some performance reasons when settting disableStream=true?

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

3 participants