Commit 5c01d089 authored by Jacob Schatz's avatar Jacob Schatz

Merge branch 'fix-pdflab-paths' into 'master'

Fix pdflab code including file paths

See merge request !10632
parents 9d96167b f1b462e7
...@@ -73,7 +73,7 @@ return /******/ (function(modules) { // webpackBootstrap ...@@ -73,7 +73,7 @@ return /******/ (function(modules) { // webpackBootstrap
/******/ __webpack_require__.p = ""; /******/ __webpack_require__.p = "";
/******/ /******/
/******/ // Load entry module and return exports /******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 16); /******/ return __webpack_require__(__webpack_require__.s = 24);
/******/ }) /******/ })
/************************************************************************/ /************************************************************************/
/******/ ({ /******/ ({
...@@ -20214,6 +20214,7 @@ var stringToUTF8String = sharedUtil.stringToUTF8String; ...@@ -20214,6 +20214,7 @@ var stringToUTF8String = sharedUtil.stringToUTF8String;
var warn = sharedUtil.warn; var warn = sharedUtil.warn;
var createValidAbsoluteUrl = sharedUtil.createValidAbsoluteUrl; var createValidAbsoluteUrl = sharedUtil.createValidAbsoluteUrl;
var Util = sharedUtil.Util; var Util = sharedUtil.Util;
var Dict = corePrimitives.Dict;
var Ref = corePrimitives.Ref; var Ref = corePrimitives.Ref;
var RefSet = corePrimitives.RefSet; var RefSet = corePrimitives.RefSet;
var RefSetCache = corePrimitives.RefSetCache; var RefSetCache = corePrimitives.RefSetCache;
...@@ -20233,9 +20234,10 @@ var Catalog = function CatalogClosure() { ...@@ -20233,9 +20234,10 @@ var Catalog = function CatalogClosure() {
this.pdfManager = pdfManager; this.pdfManager = pdfManager;
this.xref = xref; this.xref = xref;
this.catDict = xref.getCatalogObj(); this.catDict = xref.getCatalogObj();
assert(isDict(this.catDict), 'catalog object is not a dictionary');
this.fontCache = new RefSetCache(); this.fontCache = new RefSetCache();
this.builtInCMapCache = Object.create(null); this.builtInCMapCache = Object.create(null);
assert(isDict(this.catDict), 'catalog object is not a dictionary'); this.pageKidsCountCache = new RefSetCache();
this.pageFactory = pageFactory; this.pageFactory = pageFactory;
this.pagePromises = []; this.pagePromises = [];
} }
...@@ -20551,6 +20553,7 @@ var Catalog = function CatalogClosure() { ...@@ -20551,6 +20553,7 @@ var Catalog = function CatalogClosure() {
return shadow(this, 'javaScript', javaScript); return shadow(this, 'javaScript', javaScript);
}, },
cleanup: function Catalog_cleanup() { cleanup: function Catalog_cleanup() {
this.pageKidsCountCache.clear();
var promises = []; var promises = [];
this.fontCache.forEach(function (promise) { this.fontCache.forEach(function (promise) {
promises.push(promise); promises.push(promise);
...@@ -20577,15 +20580,25 @@ var Catalog = function CatalogClosure() { ...@@ -20577,15 +20580,25 @@ var Catalog = function CatalogClosure() {
getPageDict: function Catalog_getPageDict(pageIndex) { getPageDict: function Catalog_getPageDict(pageIndex) {
var capability = createPromiseCapability(); var capability = createPromiseCapability();
var nodesToVisit = [this.catDict.getRaw('Pages')]; var nodesToVisit = [this.catDict.getRaw('Pages')];
var currentPageIndex = 0; var count,
var xref = this.xref; currentPageIndex = 0;
var xref = this.xref,
pageKidsCountCache = this.pageKidsCountCache;
function next() { function next() {
while (nodesToVisit.length) { while (nodesToVisit.length) {
var currentNode = nodesToVisit.pop(); var currentNode = nodesToVisit.pop();
if (isRef(currentNode)) { if (isRef(currentNode)) {
count = pageKidsCountCache.get(currentNode);
if (count > 0 && currentPageIndex + count < pageIndex) {
currentPageIndex += count;
continue;
}
xref.fetchAsync(currentNode).then(function (obj) { xref.fetchAsync(currentNode).then(function (obj) {
if (isDict(obj, 'Page') || isDict(obj) && !obj.has('Kids')) { if (isDict(obj, 'Page') || isDict(obj) && !obj.has('Kids')) {
if (pageIndex === currentPageIndex) { if (pageIndex === currentPageIndex) {
if (currentNode && !pageKidsCountCache.has(currentNode)) {
pageKidsCountCache.put(currentNode, 1);
}
capability.resolve([obj, currentNode]); capability.resolve([obj, currentNode]);
} else { } else {
currentPageIndex++; currentPageIndex++;
...@@ -20599,7 +20612,11 @@ var Catalog = function CatalogClosure() { ...@@ -20599,7 +20612,11 @@ var Catalog = function CatalogClosure() {
return; return;
} }
assert(isDict(currentNode), 'page dictionary kid reference points to wrong type of object'); assert(isDict(currentNode), 'page dictionary kid reference points to wrong type of object');
var count = currentNode.get('Count'); count = currentNode.get('Count');
var objId = currentNode.objId;
if (objId && !pageKidsCountCache.has(objId)) {
pageKidsCountCache.put(objId, count);
}
if (currentPageIndex + count <= pageIndex) { if (currentPageIndex + count <= pageIndex) {
currentPageIndex += count; currentPageIndex += count;
continue; continue;
...@@ -21191,7 +21208,7 @@ var XRef = function XRefClosure() { ...@@ -21191,7 +21208,7 @@ var XRef = function XRefClosure() {
var num = ref.num; var num = ref.num;
if (num in this.cache) { if (num in this.cache) {
var cacheEntry = this.cache[num]; var cacheEntry = this.cache[num];
if (isDict(cacheEntry) && !cacheEntry.objId) { if (cacheEntry instanceof Dict && !cacheEntry.objId) {
cacheEntry.objId = ref.toString(); cacheEntry.objId = ref.toString();
} }
return cacheEntry; return cacheEntry;
...@@ -26178,7 +26195,7 @@ var CMapFactory = function CMapFactoryClosure() { ...@@ -26178,7 +26195,7 @@ var CMapFactory = function CMapFactoryClosure() {
return Promise.resolve(new IdentityCMap(true, 2)); return Promise.resolve(new IdentityCMap(true, 2));
} }
if (BUILT_IN_CMAPS.indexOf(name) === -1) { if (BUILT_IN_CMAPS.indexOf(name) === -1) {
return Promise.reject(new Error('Unknown cMap name: ' + name)); return Promise.reject(new Error('Unknown CMap name: ' + name));
} }
assert(fetchBuiltInCMap, 'Built-in CMap parameters are not provided.'); assert(fetchBuiltInCMap, 'Built-in CMap parameters are not provided.');
return fetchBuiltInCMap(name).then(function (data) { return fetchBuiltInCMap(name).then(function (data) {
...@@ -28458,9 +28475,6 @@ var Font = function FontClosure() { ...@@ -28458,9 +28475,6 @@ var Font = function FontClosure() {
} }
glyphId = offsetIndex < 0 ? j : offsets[offsetIndex + j - start]; glyphId = offsetIndex < 0 ? j : offsets[offsetIndex + j - start];
glyphId = glyphId + delta & 0xFFFF; glyphId = glyphId + delta & 0xFFFF;
if (glyphId === 0) {
continue;
}
mappings.push({ mappings.push({
charCode: j, charCode: j,
glyphId: glyphId glyphId: glyphId
...@@ -37160,8 +37174,8 @@ exports.Type1Parser = Type1Parser; ...@@ -37160,8 +37174,8 @@ exports.Type1Parser = Type1Parser;
"use strict"; "use strict";
var pdfjsVersion = '1.7.395'; var pdfjsVersion = '1.8.172';
var pdfjsBuild = '07f7c97b'; var pdfjsBuild = '8ff1fbe7';
var pdfjsCoreWorker = __w_pdfjs_require__(8); var pdfjsCoreWorker = __w_pdfjs_require__(8);
{ {
__w_pdfjs_require__(19); __w_pdfjs_require__(19);
...@@ -37646,20 +37660,28 @@ if (typeof PDFJS === 'undefined' || !PDFJS.compatibilityChecked) { ...@@ -37646,20 +37660,28 @@ if (typeof PDFJS === 'undefined' || !PDFJS.compatibilityChecked) {
} }
})(); })();
(function checkRequestAnimationFrame() { (function checkRequestAnimationFrame() {
function fakeRequestAnimationFrame(callback) { function installFakeAnimationFrameFunctions() {
window.setTimeout(callback, 20); window.requestAnimationFrame = function (callback) {
return window.setTimeout(callback, 20);
};
window.cancelAnimationFrame = function (timeoutID) {
window.clearTimeout(timeoutID);
};
} }
if (!hasDOM) { if (!hasDOM) {
return; return;
} }
if (isIOS) { if (isIOS) {
window.requestAnimationFrame = fakeRequestAnimationFrame; installFakeAnimationFrameFunctions();
return; return;
} }
if ('requestAnimationFrame' in window) { if ('requestAnimationFrame' in window) {
return; return;
} }
window.requestAnimationFrame = window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || fakeRequestAnimationFrame; window.requestAnimationFrame = window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame;
if (!('requestAnimationFrame' in window)) {
installFakeAnimationFrameFunctions();
}
})(); })();
(function checkCanvasSizeLimitation() { (function checkCanvasSizeLimitation() {
if (isIOS || isAndroid) { if (isIOS || isAndroid) {
...@@ -38588,7 +38610,7 @@ if (typeof PDFJS === 'undefined' || !PDFJS.compatibilityChecked) { ...@@ -38588,7 +38610,7 @@ if (typeof PDFJS === 'undefined' || !PDFJS.compatibilityChecked) {
/***/ }), /***/ }),
/***/ 16: /***/ 24:
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
/* Copyright 2016 Mozilla Foundation /* Copyright 2016 Mozilla Foundation
...@@ -71,17 +71,10 @@ return /******/ (function(modules) { // webpackBootstrap ...@@ -71,17 +71,10 @@ return /******/ (function(modules) { // webpackBootstrap
/******/ if(installedChunks[chunkId] === 0) /******/ if(installedChunks[chunkId] === 0)
/******/ return Promise.resolve(); /******/ return Promise.resolve();
/******/ /******/
/******/ // a Promise means "currently loading". /******/ // an Promise means "currently loading".
/******/ if(installedChunks[chunkId]) { /******/ if(installedChunks[chunkId]) {
/******/ return installedChunks[chunkId][2]; /******/ return installedChunks[chunkId][2];
/******/ } /******/ }
/******/
/******/ // setup Promise in chunk cache
/******/ var promise = new Promise(function(resolve, reject) {
/******/ installedChunks[chunkId] = [resolve, reject];
/******/ });
/******/ installedChunks[chunkId][2] = promise;
/******/
/******/ // start chunk loading /******/ // start chunk loading
/******/ var head = document.getElementsByTagName('head')[0]; /******/ var head = document.getElementsByTagName('head')[0];
/******/ var script = document.createElement('script'); /******/ var script = document.createElement('script');
...@@ -106,8 +99,13 @@ return /******/ (function(modules) { // webpackBootstrap ...@@ -106,8 +99,13 @@ return /******/ (function(modules) { // webpackBootstrap
/******/ installedChunks[chunkId] = undefined; /******/ installedChunks[chunkId] = undefined;
/******/ } /******/ }
/******/ }; /******/ };
/******/ head.appendChild(script);
/******/ /******/
/******/ var promise = new Promise(function(resolve, reject) {
/******/ installedChunks[chunkId] = [resolve, reject];
/******/ });
/******/ installedChunks[chunkId][2] = promise;
/******/
/******/ head.appendChild(script);
/******/ return promise; /******/ return promise;
/******/ }; /******/ };
/******/ /******/
...@@ -150,7 +148,7 @@ return /******/ (function(modules) { // webpackBootstrap ...@@ -150,7 +148,7 @@ return /******/ (function(modules) { // webpackBootstrap
/******/ __webpack_require__.oe = function(err) { console.error(err); throw err; }; /******/ __webpack_require__.oe = function(err) { console.error(err); throw err; };
/******/ /******/
/******/ // Load entry module and return exports /******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 7); /******/ return __webpack_require__(__webpack_require__.s = 23);
/******/ }) /******/ })
/************************************************************************/ /************************************************************************/
/******/ ([ /******/ ([
...@@ -1615,7 +1613,10 @@ var DOMCMapReaderFactory = function DOMCMapReaderFactoryClosure() { ...@@ -1615,7 +1613,10 @@ var DOMCMapReaderFactory = function DOMCMapReaderFactoryClosure() {
request.responseType = 'arraybuffer'; request.responseType = 'arraybuffer';
} }
request.onreadystatechange = function () { request.onreadystatechange = function () {
if (request.readyState === XMLHttpRequest.DONE && (request.status === 200 || request.status === 0)) { if (request.readyState !== XMLHttpRequest.DONE) {
return;
}
if (request.status === 200 || request.status === 0) {
var data; var data;
if (this.isCompressed && request.response) { if (this.isCompressed && request.response) {
data = new Uint8Array(request.response); data = new Uint8Array(request.response);
...@@ -1629,8 +1630,8 @@ var DOMCMapReaderFactory = function DOMCMapReaderFactoryClosure() { ...@@ -1629,8 +1630,8 @@ var DOMCMapReaderFactory = function DOMCMapReaderFactoryClosure() {
}); });
return; return;
} }
reject(new Error('Unable to load ' + (this.isCompressed ? 'binary ' : '') + 'CMap at: ' + url));
} }
reject(new Error('Unable to load ' + (this.isCompressed ? 'binary ' : '') + 'CMap at: ' + url));
}.bind(this); }.bind(this);
request.send(null); request.send(null);
}.bind(this)); }.bind(this));
...@@ -1670,6 +1671,16 @@ var CustomStyle = function CustomStyleClosure() { ...@@ -1670,6 +1671,16 @@ var CustomStyle = function CustomStyleClosure() {
}; };
return CustomStyle; return CustomStyle;
}(); }();
var RenderingCancelledException = function RenderingCancelledException() {
function RenderingCancelledException(msg, type) {
this.message = msg;
this.type = type;
}
RenderingCancelledException.prototype = new Error();
RenderingCancelledException.prototype.name = 'RenderingCancelledException';
RenderingCancelledException.constructor = RenderingCancelledException;
return RenderingCancelledException;
}();
var hasCanvasTypedArrays; var hasCanvasTypedArrays;
hasCanvasTypedArrays = function hasCanvasTypedArrays() { hasCanvasTypedArrays = function hasCanvasTypedArrays() {
var canvas = document.createElement('canvas'); var canvas = document.createElement('canvas');
...@@ -1762,6 +1773,8 @@ function getDefaultSetting(id) { ...@@ -1762,6 +1773,8 @@ function getDefaultSetting(id) {
return globalSettings ? globalSettings.externalLinkRel : DEFAULT_LINK_REL; return globalSettings ? globalSettings.externalLinkRel : DEFAULT_LINK_REL;
case 'enableStats': case 'enableStats':
return !!(globalSettings && globalSettings.enableStats); return !!(globalSettings && globalSettings.enableStats);
case 'pdfjsNext':
return !!(globalSettings && globalSettings.pdfjsNext);
default: default:
throw new Error('Unknown default setting: ' + id); throw new Error('Unknown default setting: ' + id);
} }
...@@ -1789,6 +1802,7 @@ exports.isExternalLinkTargetSet = isExternalLinkTargetSet; ...@@ -1789,6 +1802,7 @@ exports.isExternalLinkTargetSet = isExternalLinkTargetSet;
exports.isValidUrl = isValidUrl; exports.isValidUrl = isValidUrl;
exports.getFilenameFromUrl = getFilenameFromUrl; exports.getFilenameFromUrl = getFilenameFromUrl;
exports.LinkTarget = LinkTarget; exports.LinkTarget = LinkTarget;
exports.RenderingCancelledException = RenderingCancelledException;
exports.hasCanvasTypedArrays = hasCanvasTypedArrays; exports.hasCanvasTypedArrays = hasCanvasTypedArrays;
exports.getDefaultSetting = getDefaultSetting; exports.getDefaultSetting = getDefaultSetting;
exports.DEFAULT_LINK_REL = DEFAULT_LINK_REL; exports.DEFAULT_LINK_REL = DEFAULT_LINK_REL;
...@@ -2450,6 +2464,7 @@ var FontFaceObject = displayFontLoader.FontFaceObject; ...@@ -2450,6 +2464,7 @@ var FontFaceObject = displayFontLoader.FontFaceObject;
var FontLoader = displayFontLoader.FontLoader; var FontLoader = displayFontLoader.FontLoader;
var CanvasGraphics = displayCanvas.CanvasGraphics; var CanvasGraphics = displayCanvas.CanvasGraphics;
var Metadata = displayMetadata.Metadata; var Metadata = displayMetadata.Metadata;
var RenderingCancelledException = displayDOMUtils.RenderingCancelledException;
var getDefaultSetting = displayDOMUtils.getDefaultSetting; var getDefaultSetting = displayDOMUtils.getDefaultSetting;
var DOMCanvasFactory = displayDOMUtils.DOMCanvasFactory; var DOMCanvasFactory = displayDOMUtils.DOMCanvasFactory;
var DOMCMapReaderFactory = displayDOMUtils.DOMCMapReaderFactory; var DOMCMapReaderFactory = displayDOMUtils.DOMCMapReaderFactory;
...@@ -3711,7 +3726,11 @@ var InternalRenderTask = function InternalRenderTaskClosure() { ...@@ -3711,7 +3726,11 @@ var InternalRenderTask = function InternalRenderTaskClosure() {
cancel: function InternalRenderTask_cancel() { cancel: function InternalRenderTask_cancel() {
this.running = false; this.running = false;
this.cancelled = true; this.cancelled = true;
if (getDefaultSetting('pdfjsNext')) {
this.callback(new RenderingCancelledException('Rendering cancelled, page ' + this.pageNumber, 'canvas'));
} else {
this.callback('cancelled'); this.callback('cancelled');
}
}, },
operatorListChanged: function InternalRenderTask_operatorListChanged() { operatorListChanged: function InternalRenderTask_operatorListChanged() {
if (!this.graphicsReady) { if (!this.graphicsReady) {
...@@ -3776,8 +3795,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() { ...@@ -3776,8 +3795,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() {
} }
}; };
}(); }();
exports.version = '1.7.395'; exports.version = '1.8.172';
exports.build = '07f7c97b'; exports.build = '8ff1fbe7';
exports.getDocument = getDocument; exports.getDocument = getDocument;
exports.PDFDataRangeTransport = PDFDataRangeTransport; exports.PDFDataRangeTransport = PDFDataRangeTransport;
exports.PDFWorker = PDFWorker; exports.PDFWorker = PDFWorker;
...@@ -5716,8 +5735,8 @@ if (!globalScope.PDFJS) { ...@@ -5716,8 +5735,8 @@ if (!globalScope.PDFJS) {
globalScope.PDFJS = {}; globalScope.PDFJS = {};
} }
var PDFJS = globalScope.PDFJS; var PDFJS = globalScope.PDFJS;
PDFJS.version = '1.7.395'; PDFJS.version = '1.8.172';
PDFJS.build = '07f7c97b'; PDFJS.build = '8ff1fbe7';
PDFJS.pdfBug = false; PDFJS.pdfBug = false;
if (PDFJS.verbosity !== undefined) { if (PDFJS.verbosity !== undefined) {
sharedUtil.setVerbosityLevel(PDFJS.verbosity); sharedUtil.setVerbosityLevel(PDFJS.verbosity);
...@@ -5777,6 +5796,7 @@ PDFJS.disableWebGL = PDFJS.disableWebGL === undefined ? true : PDFJS.disableWebG ...@@ -5777,6 +5796,7 @@ PDFJS.disableWebGL = PDFJS.disableWebGL === undefined ? true : PDFJS.disableWebG
PDFJS.externalLinkTarget = PDFJS.externalLinkTarget === undefined ? LinkTarget.NONE : PDFJS.externalLinkTarget; PDFJS.externalLinkTarget = PDFJS.externalLinkTarget === undefined ? LinkTarget.NONE : PDFJS.externalLinkTarget;
PDFJS.externalLinkRel = PDFJS.externalLinkRel === undefined ? DEFAULT_LINK_REL : PDFJS.externalLinkRel; PDFJS.externalLinkRel = PDFJS.externalLinkRel === undefined ? DEFAULT_LINK_REL : PDFJS.externalLinkRel;
PDFJS.isEvalSupported = PDFJS.isEvalSupported === undefined ? true : PDFJS.isEvalSupported; PDFJS.isEvalSupported = PDFJS.isEvalSupported === undefined ? true : PDFJS.isEvalSupported;
PDFJS.pdfjsNext = PDFJS.pdfjsNext === undefined ? false : PDFJS.pdfjsNext;
var savedOpenExternalLinksInNewWindow = PDFJS.openExternalLinksInNewWindow; var savedOpenExternalLinksInNewWindow = PDFJS.openExternalLinksInNewWindow;
delete PDFJS.openExternalLinksInNewWindow; delete PDFJS.openExternalLinksInNewWindow;
Object.defineProperty(PDFJS, 'openExternalLinksInNewWindow', { Object.defineProperty(PDFJS, 'openExternalLinksInNewWindow', {
...@@ -8227,8 +8247,8 @@ exports.TilingPattern = TilingPattern; ...@@ -8227,8 +8247,8 @@ exports.TilingPattern = TilingPattern;
"use strict"; "use strict";
var pdfjsVersion = '1.7.395'; var pdfjsVersion = '1.8.172';
var pdfjsBuild = '07f7c97b'; var pdfjsBuild = '8ff1fbe7';
var pdfjsSharedUtil = __w_pdfjs_require__(0); var pdfjsSharedUtil = __w_pdfjs_require__(0);
var pdfjsDisplayGlobal = __w_pdfjs_require__(9); var pdfjsDisplayGlobal = __w_pdfjs_require__(9);
var pdfjsDisplayAPI = __w_pdfjs_require__(3); var pdfjsDisplayAPI = __w_pdfjs_require__(3);
...@@ -8259,6 +8279,7 @@ exports.createObjectURL = pdfjsSharedUtil.createObjectURL; ...@@ -8259,6 +8279,7 @@ exports.createObjectURL = pdfjsSharedUtil.createObjectURL;
exports.removeNullCharacters = pdfjsSharedUtil.removeNullCharacters; exports.removeNullCharacters = pdfjsSharedUtil.removeNullCharacters;
exports.shadow = pdfjsSharedUtil.shadow; exports.shadow = pdfjsSharedUtil.shadow;
exports.createBlob = pdfjsSharedUtil.createBlob; exports.createBlob = pdfjsSharedUtil.createBlob;
exports.RenderingCancelledException = pdfjsDisplayDOMUtils.RenderingCancelledException;
exports.getFilenameFromUrl = pdfjsDisplayDOMUtils.getFilenameFromUrl; exports.getFilenameFromUrl = pdfjsDisplayDOMUtils.getFilenameFromUrl;
exports.addLinkAttributes = pdfjsDisplayDOMUtils.addLinkAttributes; exports.addLinkAttributes = pdfjsDisplayDOMUtils.addLinkAttributes;
...@@ -8740,20 +8761,28 @@ if (typeof PDFJS === 'undefined' || !PDFJS.compatibilityChecked) { ...@@ -8740,20 +8761,28 @@ if (typeof PDFJS === 'undefined' || !PDFJS.compatibilityChecked) {
} }
})(); })();
(function checkRequestAnimationFrame() { (function checkRequestAnimationFrame() {
function fakeRequestAnimationFrame(callback) { function installFakeAnimationFrameFunctions() {
window.setTimeout(callback, 20); window.requestAnimationFrame = function (callback) {
return window.setTimeout(callback, 20);
};
window.cancelAnimationFrame = function (timeoutID) {
window.clearTimeout(timeoutID);
};
} }
if (!hasDOM) { if (!hasDOM) {
return; return;
} }
if (isIOS) { if (isIOS) {
window.requestAnimationFrame = fakeRequestAnimationFrame; installFakeAnimationFrameFunctions();
return; return;
} }
if ('requestAnimationFrame' in window) { if ('requestAnimationFrame' in window) {
return; return;
} }
window.requestAnimationFrame = window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || fakeRequestAnimationFrame; window.requestAnimationFrame = window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame;
if (!('requestAnimationFrame' in window)) {
installFakeAnimationFrameFunctions();
}
})(); })();
(function checkCanvasSizeLimitation() { (function checkCanvasSizeLimitation() {
if (isIOS || isAndroid) { if (isIOS || isAndroid) {
...@@ -9760,7 +9789,7 @@ function toComment(sourceMap) { ...@@ -9760,7 +9789,7 @@ function toComment(sourceMap) {
return '/*# ' + data + ' */'; return '/*# ' + data + ' */';
} }
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(11).Buffer)) /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(10).Buffer))
/***/ }), /***/ }),
/* 4 */ /* 4 */
...@@ -9839,7 +9868,7 @@ if (typeof DEBUG !== 'undefined' && DEBUG) { ...@@ -9839,7 +9868,7 @@ if (typeof DEBUG !== 'undefined' && DEBUG) {
) } ) }
} }
var listToStyles = __webpack_require__(23) var listToStyles = __webpack_require__(21)
/* /*
type StyleObject = { type StyleObject = {
...@@ -10046,34 +10075,18 @@ function applyToTag (styleElement, obj) { ...@@ -10046,34 +10075,18 @@ function applyToTag (styleElement, obj) {
/* styles */ /* styles */
__webpack_require__(21) __webpack_require__(19)
var Component = __webpack_require__(4)( var Component = __webpack_require__(4)(
/* script */ /* script */
__webpack_require__(8), __webpack_require__(7),
/* template */ /* template */
__webpack_require__(19), __webpack_require__(17),
/* scopeId */ /* scopeId */
null, null,
/* cssModules */ /* cssModules */
null null
) )
Component.options.__file = "/Users/samrose/Projects/pdflab/src/index.vue"
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key !== "__esModule"})) {console.error("named exports are not supported in *.vue files.")}
if (Component.options.functional) {console.error("[vue-loader] index.vue: functional components are not supported with templates, they should use render functions.")}
/* hot reload */
if (false) {(function () {
var hotAPI = require("vue-hot-reload-api")
hotAPI.install(require("vue"), false)
if (!hotAPI.compatible) return
module.hot.accept()
if (!module.hot.data) {
hotAPI.createRecord("data-v-7c7bed7e", Component.options)
} else {
hotAPI.reload("data-v-7c7bed7e", Component.options)
}
})()}
module.exports = Component.exports module.exports = Component.exports
...@@ -10085,25 +10098,6 @@ module.exports = Component.exports ...@@ -10085,25 +10098,6 @@ module.exports = Component.exports
"use strict"; "use strict";
var PDF = __webpack_require__(6);
var pdfjsLib = __webpack_require__(2);
module.exports = {
install: function install(_vue, _ref) {
var workerSrc = _ref.workerSrc;
pdfjsLib.PDFJS.workerSrc = workerSrc;
_vue.component('pdf-lab', PDF);
}
};
/***/ }),
/* 8 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { Object.defineProperty(exports, "__esModule", {
value: true value: true
}); });
...@@ -10112,7 +10106,7 @@ var _pdfjsDist = __webpack_require__(2); ...@@ -10112,7 +10106,7 @@ var _pdfjsDist = __webpack_require__(2);
var _pdfjsDist2 = _interopRequireDefault(_pdfjsDist); var _pdfjsDist2 = _interopRequireDefault(_pdfjsDist);
var _index = __webpack_require__(18); var _index = __webpack_require__(16);
var _index2 = _interopRequireDefault(_index); var _index2 = _interopRequireDefault(_index);
...@@ -10138,7 +10132,7 @@ exports.default = { ...@@ -10138,7 +10132,7 @@ exports.default = {
}, },
data: function data() { data: function data() {
return { return {
isLoading: false, loading: false,
pages: [] pages: []
}; };
}, },
...@@ -10163,17 +10157,17 @@ exports.default = { ...@@ -10163,17 +10157,17 @@ exports.default = {
}).catch(function (error) { }).catch(function (error) {
return _this.$emit('pdflaberror', error); return _this.$emit('pdflaberror', error);
}).then(function () { }).then(function () {
return _this.isLoading = false; _this.loading = false;
}); });
}, },
renderPages: function renderPages(pdf) { renderPages: function renderPages(pdf) {
var _this2 = this; var _this2 = this;
var pagePromises = []; var pagePromises = [];
this.isLoading = true; this.loading = true;
for (var num = 1; num <= pdf.numPages; num++) { for (var num = 1; num <= pdf.numPages; num += 1) {
pagePromises.push(pdf.getPage(num).then(function (page) { pagePromises.push(pdf.getPage(num).then(function (p) {
return _this2.pages.push(page); return _this2.pages.push(p);
})); }));
} }
return Promise.all(pagePromises); return Promise.all(pagePromises);
...@@ -10185,7 +10179,7 @@ exports.default = { ...@@ -10185,7 +10179,7 @@ exports.default = {
}; };
/***/ }), /***/ }),
/* 9 */ /* 8 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
"use strict"; "use strict";
...@@ -10213,10 +10207,16 @@ exports.default = { ...@@ -10213,10 +10207,16 @@ exports.default = {
required: true required: true
} }
}, },
data: function data() {
return {
scale: 4,
rendering: false
};
},
computed: { computed: {
viewport: function viewport() { viewport: function viewport() {
var scale = 4; return this.page.getViewport(this.scale);
return this.page.getViewport(scale);
}, },
context: function context() { context: function context() {
return this.$refs.canvas.getContext('2d'); return this.$refs.canvas.getContext('2d');
...@@ -10229,14 +10229,19 @@ exports.default = { ...@@ -10229,14 +10229,19 @@ exports.default = {
} }
}, },
mounted: function mounted() { mounted: function mounted() {
var _this = this;
this.$refs.canvas.height = this.viewport.height; this.$refs.canvas.height = this.viewport.height;
this.$refs.canvas.width = this.viewport.width; this.$refs.canvas.width = this.viewport.width;
this.page.render(this.renderContext); this.rendering = true;
this.page.render(this.renderContext).then(function () {
_this.rendering = false;
});
} }
}; };
/***/ }), /***/ }),
/* 10 */ /* 9 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
"use strict"; "use strict";
...@@ -10357,7 +10362,7 @@ function fromByteArray (uint8) { ...@@ -10357,7 +10362,7 @@ function fromByteArray (uint8) {
/***/ }), /***/ }),
/* 11 */ /* 10 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
"use strict"; "use strict";
...@@ -10371,9 +10376,9 @@ function fromByteArray (uint8) { ...@@ -10371,9 +10376,9 @@ function fromByteArray (uint8) {
var base64 = __webpack_require__(10) var base64 = __webpack_require__(9)
var ieee754 = __webpack_require__(14) var ieee754 = __webpack_require__(13)
var isArray = __webpack_require__(15) var isArray = __webpack_require__(14)
exports.Buffer = Buffer exports.Buffer = Buffer
exports.SlowBuffer = SlowBuffer exports.SlowBuffer = SlowBuffer
...@@ -12151,10 +12156,10 @@ function isnan (val) { ...@@ -12151,10 +12156,10 @@ function isnan (val) {
return val !== val // eslint-disable-line no-self-compare return val !== val // eslint-disable-line no-self-compare
} }
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(24))) /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(22)))
/***/ }), /***/ }),
/* 12 */ /* 11 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__(3)(undefined); exports = module.exports = __webpack_require__(3)(undefined);
...@@ -12162,13 +12167,13 @@ exports = module.exports = __webpack_require__(3)(undefined); ...@@ -12162,13 +12167,13 @@ exports = module.exports = __webpack_require__(3)(undefined);
// module // module
exports.push([module.i, "\n.pdf-viewer {\n background: url(" + __webpack_require__(17) + ");\n display: flex;\n flex-flow: column nowrap;\n}\n", ""]); exports.push([module.i, ".pdf-viewer{background:url(" + __webpack_require__(15) + ");display:flex;flex-flow:column nowrap}", ""]);
// exports // exports
/***/ }), /***/ }),
/* 13 */ /* 12 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__(3)(undefined); exports = module.exports = __webpack_require__(3)(undefined);
...@@ -12176,13 +12181,13 @@ exports = module.exports = __webpack_require__(3)(undefined); ...@@ -12176,13 +12181,13 @@ exports = module.exports = __webpack_require__(3)(undefined);
// module // module
exports.push([module.i, "\n.pdf-page {\n margin: 8px auto 0 auto;\n border-top: 1px #ddd solid;\n border-bottom: 1px #ddd solid;\n width: 100%;\n}\n.pdf-page:first-child {\n margin-top: 0px;\n border-top: 0px;\n}\n.pdf-page:last-child {\n margin-bottom: 0px;\n border-bottom: 0px;\n}\n", ""]); exports.push([module.i, ".pdf-page{margin:8px auto 0;border-top:1px solid #ddd;border-bottom:1px solid #ddd;width:100%}.pdf-page:first-child{margin-top:0;border-top:0}.pdf-page:last-child{margin-bottom:0;border-bottom:0}", ""]);
// exports // exports
/***/ }), /***/ }),
/* 14 */ /* 13 */
/***/ (function(module, exports) { /***/ (function(module, exports) {
exports.read = function (buffer, offset, isLE, mLen, nBytes) { exports.read = function (buffer, offset, isLE, mLen, nBytes) {
...@@ -12272,7 +12277,7 @@ exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { ...@@ -12272,7 +12277,7 @@ exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
/***/ }), /***/ }),
/* 15 */ /* 14 */
/***/ (function(module, exports) { /***/ (function(module, exports) {
var toString = {}.toString; var toString = {}.toString;
...@@ -12283,53 +12288,36 @@ module.exports = Array.isArray || function (arr) { ...@@ -12283,53 +12288,36 @@ module.exports = Array.isArray || function (arr) {
/***/ }), /***/ }),
/* 16 */, /* 15 */
/* 17 */
/***/ (function(module, exports) { /***/ (function(module, exports) {
module.exports = "data:image/gif;base64,R0lGODlhCgAKAIAAAOXl5f///yH5BAAAAAAALAAAAAAKAAoAAAIRhB2ZhxoM3GMSykqd1VltzxQAOw==" module.exports = "data:image/gif;base64,R0lGODlhCgAKAIAAAOXl5f///yH5BAAAAAAALAAAAAAKAAoAAAIRhB2ZhxoM3GMSykqd1VltzxQAOw=="
/***/ }), /***/ }),
/* 18 */ /* 16 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
/* styles */ /* styles */
__webpack_require__(22) __webpack_require__(20)
var Component = __webpack_require__(4)( var Component = __webpack_require__(4)(
/* script */ /* script */
__webpack_require__(9), __webpack_require__(8),
/* template */ /* template */
__webpack_require__(20), __webpack_require__(18),
/* scopeId */ /* scopeId */
null, null,
/* cssModules */ /* cssModules */
null null
) )
Component.options.__file = "/Users/samrose/Projects/pdflab/src/page/index.vue"
if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key !== "__esModule"})) {console.error("named exports are not supported in *.vue files.")}
if (Component.options.functional) {console.error("[vue-loader] index.vue: functional components are not supported with templates, they should use render functions.")}
/* hot reload */
if (false) {(function () {
var hotAPI = require("vue-hot-reload-api")
hotAPI.install(require("vue"), false)
if (!hotAPI.compatible) return
module.hot.accept()
if (!module.hot.data) {
hotAPI.createRecord("data-v-7e912b1a", Component.options)
} else {
hotAPI.reload("data-v-7e912b1a", Component.options)
}
})()}
module.exports = Component.exports module.exports = Component.exports
/***/ }), /***/ }),
/* 19 */ /* 17 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports) {
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h; module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
return (_vm.hasPDF) ? _c('div', { return (_vm.hasPDF) ? _c('div', {
...@@ -12338,24 +12326,17 @@ module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c ...@@ -12338,24 +12326,17 @@ module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c
return _c('page', { return _c('page', {
key: index, key: index,
attrs: { attrs: {
"v-if": !_vm.isLoading, "v-if": !_vm.loading,
"page": page, "page": page,
"number": index + 1 "number": index + 1
} }
}) })
})) : _vm._e() })) : _vm._e()
},staticRenderFns: []} },staticRenderFns: []}
module.exports.render._withStripped = true
if (false) {
module.hot.accept()
if (module.hot.data) {
require("vue-hot-reload-api").rerender("data-v-7c7bed7e", module.exports)
}
}
/***/ }), /***/ }),
/* 20 */ /* 18 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports) {
module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h; module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
return _c('canvas', { return _c('canvas', {
...@@ -12366,32 +12347,25 @@ module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c ...@@ -12366,32 +12347,25 @@ module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c
} }
}) })
},staticRenderFns: []} },staticRenderFns: []}
module.exports.render._withStripped = true
if (false) {
module.hot.accept()
if (module.hot.data) {
require("vue-hot-reload-api").rerender("data-v-7e912b1a", module.exports)
}
}
/***/ }), /***/ }),
/* 21 */ /* 19 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
// style-loader: Adds some css to the DOM by adding a <style> tag // style-loader: Adds some css to the DOM by adding a <style> tag
// load the styles // load the styles
var content = __webpack_require__(12); var content = __webpack_require__(11);
if(typeof content === 'string') content = [[module.i, content, '']]; if(typeof content === 'string') content = [[module.i, content, '']];
if(content.locals) module.exports = content.locals; if(content.locals) module.exports = content.locals;
// add the styles to the DOM // add the styles to the DOM
var update = __webpack_require__(5)("8018213c", content, false); var update = __webpack_require__(5)("59cf066f", content, true);
// Hot Module Replacement // Hot Module Replacement
if(false) { if(false) {
// When the styles change, update the <style> tags // When the styles change, update the <style> tags
if(!content.locals) { if(!content.locals) {
module.hot.accept("!!../node_modules/css-loader/index.js!../node_modules/vue-loader/lib/style-compiler/index.js?{\"id\":\"data-v-7c7bed7e\",\"scoped\":false,\"hasInlineConfig\":false}!../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./index.vue", function() { module.hot.accept("!!../node_modules/css-loader/index.js?minimize!../node_modules/vue-loader/lib/style-compiler/index.js?{\"id\":\"data-v-7c7bed7e\",\"scoped\":false,\"hasInlineConfig\":false}!../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./index.vue", function() {
var newContent = require("!!../node_modules/css-loader/index.js!../node_modules/vue-loader/lib/style-compiler/index.js?{\"id\":\"data-v-7c7bed7e\",\"scoped\":false,\"hasInlineConfig\":false}!../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./index.vue"); var newContent = require("!!../node_modules/css-loader/index.js?minimize!../node_modules/vue-loader/lib/style-compiler/index.js?{\"id\":\"data-v-7c7bed7e\",\"scoped\":false,\"hasInlineConfig\":false}!../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./index.vue");
if(typeof newContent === 'string') newContent = [[module.id, newContent, '']]; if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
update(newContent); update(newContent);
}); });
...@@ -12401,23 +12375,23 @@ if(false) { ...@@ -12401,23 +12375,23 @@ if(false) {
} }
/***/ }), /***/ }),
/* 22 */ /* 20 */
/***/ (function(module, exports, __webpack_require__) { /***/ (function(module, exports, __webpack_require__) {
// style-loader: Adds some css to the DOM by adding a <style> tag // style-loader: Adds some css to the DOM by adding a <style> tag
// load the styles // load the styles
var content = __webpack_require__(13); var content = __webpack_require__(12);
if(typeof content === 'string') content = [[module.i, content, '']]; if(typeof content === 'string') content = [[module.i, content, '']];
if(content.locals) module.exports = content.locals; if(content.locals) module.exports = content.locals;
// add the styles to the DOM // add the styles to the DOM
var update = __webpack_require__(5)("6d9dea59", content, false); var update = __webpack_require__(5)("09f1e2d8", content, true);
// Hot Module Replacement // Hot Module Replacement
if(false) { if(false) {
// When the styles change, update the <style> tags // When the styles change, update the <style> tags
if(!content.locals) { if(!content.locals) {
module.hot.accept("!!../../node_modules/css-loader/index.js!../../node_modules/vue-loader/lib/style-compiler/index.js?{\"id\":\"data-v-7e912b1a\",\"scoped\":false,\"hasInlineConfig\":false}!../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./index.vue", function() { module.hot.accept("!!../../node_modules/css-loader/index.js?minimize!../../node_modules/vue-loader/lib/style-compiler/index.js?{\"id\":\"data-v-7e912b1a\",\"scoped\":false,\"hasInlineConfig\":false}!../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./index.vue", function() {
var newContent = require("!!../../node_modules/css-loader/index.js!../../node_modules/vue-loader/lib/style-compiler/index.js?{\"id\":\"data-v-7e912b1a\",\"scoped\":false,\"hasInlineConfig\":false}!../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./index.vue"); var newContent = require("!!../../node_modules/css-loader/index.js?minimize!../../node_modules/vue-loader/lib/style-compiler/index.js?{\"id\":\"data-v-7e912b1a\",\"scoped\":false,\"hasInlineConfig\":false}!../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./index.vue");
if(typeof newContent === 'string') newContent = [[module.id, newContent, '']]; if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
update(newContent); update(newContent);
}); });
...@@ -12427,7 +12401,7 @@ if(false) { ...@@ -12427,7 +12401,7 @@ if(false) {
} }
/***/ }), /***/ }),
/* 23 */ /* 21 */
/***/ (function(module, exports) { /***/ (function(module, exports) {
/** /**
...@@ -12460,7 +12434,7 @@ module.exports = function listToStyles (parentId, list) { ...@@ -12460,7 +12434,7 @@ module.exports = function listToStyles (parentId, list) {
/***/ }), /***/ }),
/* 24 */ /* 22 */
/***/ (function(module, exports) { /***/ (function(module, exports) {
var g; var g;
...@@ -12486,6 +12460,25 @@ try { ...@@ -12486,6 +12460,25 @@ try {
module.exports = g; module.exports = g;
/***/ }),
/* 23 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var PDF = __webpack_require__(6);
var pdfjsLib = __webpack_require__(2);
module.exports = {
install: function install(_vue) {
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
pdfjsLib.PDFJS.workerSrc = options.workerSrc || '';
_vue.component('pdf-lab', PDF);
}
};
/***/ }) /***/ })
/******/ ]); /******/ ]);
}); });
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment