Move the cMapUrl and cMapPacked options from the global PDFJS object and into getDocument instead

This commit is contained in:
Jonas Jenwald 2018-02-17 16:57:24 +01:00
parent b674409397
commit 3c2fbdffe6
13 changed files with 72 additions and 63 deletions

View file

@ -24,8 +24,8 @@ if (typeof PDFJS === 'undefined' || !PDFJS.PDFViewer || !PDFJS.getDocument) {
var USE_ONLY_CSS_ZOOM = true;
var TEXT_LAYER_MODE = 0; // DISABLE
var MAX_IMAGE_SIZE = 1024 * 1024;
PDFJS.cMapUrl = '../../node_modules/pdfjs-dist/cmaps/';
PDFJS.cMapPacked = true;
var CMAP_URL = '../../node_modules/pdfjs-dist/cmaps/';
var CMAP_PACKED = true;
PDFJS.GlobalWorkerOptions.workerSrc =
'../../node_modules/pdfjs-dist/build/pdf.worker.js';
@ -65,6 +65,8 @@ var PDFViewerApplication = {
var loadingTask = PDFJS.getDocument({
url: url,
maxImageSize: MAX_IMAGE_SIZE,
cMapUrl: CMAP_URL,
cMapPacked: CMAP_PACKED,
});
this.pdfLoadingTask = loadingTask;