-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
disableAutoFetch=true not working with big pdf #3811
Comments
There's something strange going on with that pdf. It doesn't seem to be doing range requests. Also, when I use our browser to explore the object structure and expand the contents of one page it gives me the stream with the entire pdf in it. |
Disregard the comment about the browser. It was a bug I introduced in the browser. |
So you are able to reproduce the problem? I do have the same issue with other files. I'll try again with a very big text only pdf file and see what happens. |
I just tested some different pdfs. I created a docx source with google docs and generated 3 pdf's from it.
Disabling the autofetch doesn't work with the Libre Office file. It does work with the other ones. Note that the one generated by Microsoft Office get's almost completely loaded. Is this because the very small file size? The one generated by Google Docs is loaded in nice chunks. |
The problem is we traverse the whole page tree which causes the majority of the chunks of the PDF to be fetched. I have a patch to fix this, but it requires redoing some other pieces as well. |
@brendandahl |
@iFadey You also need to disable streaming, which was added in PR #5263, for this to work; see https://github.com/mozilla/pdf.js/blob/master/src/display/api.js#L90-L96. |
@Snuffleupagus I see. Let me try it. Thanks! |
Yes it's working now with stream disabled. |
I'm having issues with the disableAutoFetch param. It works with the example pdf but not with a big pdf file. Note that I'm retrieving the pdf file in chunks, that part is working beautifully. But it seems to download the complete file ignoring the disableAutoFetch param. I've been investigating this issue for a few hours now but couldn't find much. I'll continue my effort but I'm hoping on some input of you guys!
The pdf file that I used to test:
http://www.nbb.be/DOC/BA/PDF7MB/2010/201011400154_2.pdf
I found out that the viewer first caches a few pages and that this is normal behaviour. But after caching those few pages it downloads all the others. It's like some other component is invoking this. Its the same as when you open the example pdf and then do a text search. That action triggers the viewer to download the pdf completely.
The text was updated successfully, but these errors were encountered: