mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 02:05:37 +02:00
Move the disableCreateObjectURL
option from the global PDFJS
object and into getDocument
instead
This commit is contained in:
parent
05c05bdef5
commit
1d03ad0060
11 changed files with 54 additions and 36 deletions
|
@ -15,7 +15,6 @@
|
|||
|
||||
import { CSS_UNITS, NullL10n } from './ui_utils';
|
||||
import { PDFPrintServiceFactory, PDFViewerApplication } from './app';
|
||||
import { PDFJS } from 'pdfjs-lib';
|
||||
|
||||
let activeService = null;
|
||||
let overlayManager = null;
|
||||
|
@ -62,6 +61,8 @@ function PDFPrintService(pdfDocument, pagesOverview, printContainer, l10n) {
|
|||
this.pagesOverview = pagesOverview;
|
||||
this.printContainer = printContainer;
|
||||
this.l10n = l10n || NullL10n;
|
||||
this.disableCreateObjectURL =
|
||||
pdfDocument.loadingParams['disableCreateObjectURL'];
|
||||
this.currentPage = -1;
|
||||
// The temporary canvas where renderPage paints one page at a time.
|
||||
this.scratchCanvas = document.createElement('canvas');
|
||||
|
@ -153,7 +154,7 @@ PDFPrintService.prototype = {
|
|||
img.style.height = printItem.height;
|
||||
|
||||
let scratchCanvas = this.scratchCanvas;
|
||||
if (('toBlob' in scratchCanvas) && !PDFJS.disableCreateObjectURL) {
|
||||
if (('toBlob' in scratchCanvas) && !this.disableCreateObjectURL) {
|
||||
scratchCanvas.toBlob(function(blob) {
|
||||
img.src = URL.createObjectURL(blob);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue