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

Add Pdf.js support for progressive loading of pdf. #1

Open
loftux opened this issue Apr 19, 2013 · 5 comments
Open

Add Pdf.js support for progressive loading of pdf. #1

loftux opened this issue Apr 19, 2013 · 5 comments
Assignees
Milestone

Comments

@loftux
Copy link
Member

loftux commented Apr 19, 2013

pdf.js has implemented support for progressive loading of pdf.
mozilla/pdf.js#2719

I will create a branch to try this feature out.

TBD if to add progress bar when loading large pdf:s

@wabson
Copy link
Member

wabson commented Jun 25, 2013

Peter, did you create a branch for this feature in the end?

@loftux
Copy link
Member Author

loftux commented Jun 26, 2013

Yes, I've created a pdfjs branch where i pull in all the latest from pdf.js project.
So you can check out that branch to test. I just updated it to the latest from Mozilla pdf.js.

The progressive loading is disabled by default. To test out those features you manually need to update in PdfJs.js
Current settings
// PDFJS Disable new range feature if not loading from first page
PDFJS.disableRange = true;
// disable autofetch - retrieve just the ranges needed to display
PDFJS.disableAutoFetch = false;
I added them as there were issues if pdf was not loaded from page 1 (ie if you had viewed the page previously and the pdf tried to load from stored page number). This may have been fixed now, haven't tested that.

Set disableRange to false to test.
disableAutoFetch = true will as I understand just fetch the range that is needed for display.

In Safari there is a bug, so PDFJS.disableRange is set to true in compatibility.js, if we move forward to implement this we must make sure we do not overwrite this for Safari. mozilla/pdf.js#3352

loftux added a commit that referenced this issue Oct 22, 2013
- New attribute added: progressiveLoading with default false.
- Added new configuration option to enable this by module config.
@loftux
Copy link
Member Author

loftux commented Oct 22, 2013

I've now added configuration support.
However, I'm not sure we should keep the Module configuration option in final release. There are already a lot of viewer configuration options and this will only confuse.
Add to this that in most cases the loading of the pdf is slower.

Besides enabling the loading, we have to rewrite the pdf page rendering for this to become useful, and that is part of next milestone.

@wabson
Copy link
Member

wabson commented Oct 22, 2013

Agreed. The module is useful for developers experimenting with progressive loading but it is yet another one that will show up in the console.

What about giving the extension module file a .sample suffix, then we leave it in there but it would be disabled for now?

@loftux
Copy link
Member Author

loftux commented Oct 23, 2013

I removed the config for now, and changing milestone to next interation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants