Merge pull request #11263 from Snuffleupagus/viewer-disableAutoFetch-pagesCount

Attempt to reduce resource usage, by not eagerly fetching all pages, for long/large documents
This commit is contained in:
Tim van der Meij 2019-10-20 15:24:17 +02:00 committed by GitHub
commit d7f651aa98
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -454,7 +454,10 @@ class BaseViewer {
this.findController.setDocument(pdfDocument); // Enable searching. this.findController.setDocument(pdfDocument); // Enable searching.
} }
if (pdfDocument.loadingParams['disableAutoFetch']) { // In addition to 'disableAutoFetch' being set, also attempt to reduce
// resource usage when loading *very* long/large documents.
if (pdfDocument.loadingParams['disableAutoFetch'] ||
pagesCount > 7500) {
// XXX: Printing is semi-broken with auto fetch disabled. // XXX: Printing is semi-broken with auto fetch disabled.
pagesCapability.resolve(); pagesCapability.resolve();
return; return;