Browse Source

PDF.js version 1.8.306 - See mozilla/pdf.js@2ac410625b6a5385701092aaa83bb0b10b79e98a

master v1.8.306
pdfjsbot 8 years ago
parent
commit
e639db61ed
  1. 2
      bower.json
  2. 259
      build/pdf.combined.js
  3. 115
      build/pdf.js
  4. 12
      build/pdf.min.js
  5. 150
      build/pdf.worker.js
  6. 28
      build/pdf.worker.min.js
  7. 20
      lib/core/annotation.js
  8. 8
      lib/core/chunked_stream.js
  9. 57
      lib/core/document.js
  10. 8
      lib/core/fonts.js
  11. 34
      lib/core/obj.js
  12. 19
      lib/core/worker.js
  13. 105
      lib/display/api.js
  14. 5
      lib/display/global.js
  15. 5
      lib/pdf.js
  16. 4
      lib/pdf.worker.js
  17. 2
      package.json

2
bower.json

@ -1,6 +1,6 @@
{ {
"name": "pdfjs-dist", "name": "pdfjs-dist",
"version": "1.8.292", "version": "1.8.306",
"main": [ "main": [
"build/pdf.js", "build/pdf.js",
"build/pdf.worker.js" "build/pdf.worker.js"

259
build/pdf.combined.js

@ -11484,7 +11484,9 @@ exports.AnnotationLayer = AnnotationLayer;
Object.defineProperty(exports, "__esModule", { Object.defineProperty(exports, "__esModule", {
value: true value: true
}); });
exports.build = exports.version = exports._UnsupportedManager = exports.PDFPageProxy = exports.PDFDocumentProxy = exports.PDFWorker = exports.PDFDataRangeTransport = exports.getDocument = undefined; exports.build = exports.version = exports._UnsupportedManager = exports.PDFPageProxy = exports.PDFDocumentProxy = exports.PDFWorker = exports.PDFDataRangeTransport = exports.LoopbackPort = exports.getDocument = undefined;
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
@ -11498,6 +11500,8 @@ var _canvas = __w_pdfjs_require__(44);
var _metadata = __w_pdfjs_require__(24); var _metadata = __w_pdfjs_require__(24);
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var DEFAULT_RANGE_CHUNK_SIZE = 65536; var DEFAULT_RANGE_CHUNK_SIZE = 65536;
var isWorkerDisabled = false; var isWorkerDisabled = false;
var workerSrc; var workerSrc;
@ -11989,40 +11993,19 @@ var PDFPageProxy = function PDFPageProxyClosure() {
}; };
return PDFPageProxy; return PDFPageProxy;
}(); }();
var PDFWorker = function PDFWorkerClosure() {
var nextFakeWorkerId = 0; var LoopbackPort = function () {
function getWorkerSrc() { function LoopbackPort(defer) {
if (typeof workerSrc !== 'undefined') { _classCallCheck(this, LoopbackPort);
return workerSrc;
}
if ((0, _dom_utils.getDefaultSetting)('workerSrc')) {
return (0, _dom_utils.getDefaultSetting)('workerSrc');
}
if (pdfjsFilePath) {
return pdfjsFilePath.replace(/(\.(?:min\.)?js)(\?.*)?$/i, '.worker$1$2');
}
(0, _util.error)('No PDFJS.workerSrc specified');
}
var fakeWorkerFilesLoadedCapability;
function setupFakeWorkerGlobal() {
var WorkerMessageHandler;
if (fakeWorkerFilesLoadedCapability) {
return fakeWorkerFilesLoadedCapability.promise;
}
fakeWorkerFilesLoadedCapability = (0, _util.createPromiseCapability)();
var pdfjsCoreWorker = __w_pdfjs_require__(23);
__w_pdfjs_require__(39);
WorkerMessageHandler = pdfjsCoreWorker.WorkerMessageHandler;
fakeWorkerFilesLoadedCapability.resolve(WorkerMessageHandler);
return fakeWorkerFilesLoadedCapability.promise;
}
function FakeWorkerPort(defer) {
this._listeners = []; this._listeners = [];
this._defer = defer; this._defer = defer;
this._deferred = Promise.resolve(undefined); this._deferred = Promise.resolve(undefined);
} }
FakeWorkerPort.prototype = {
postMessage: function postMessage(obj, transfers) { _createClass(LoopbackPort, [{
key: 'postMessage',
value: function postMessage(obj, transfers) {
function cloneValue(value) { function cloneValue(value) {
if ((typeof value === 'undefined' ? 'undefined' : _typeof(value)) !== 'object' || value === null) { if ((typeof value === 'undefined' ? 'undefined' : _typeof(value)) !== 'object' || value === null) {
return value; return value;
@ -12072,18 +12055,55 @@ var PDFWorker = function PDFWorkerClosure() {
listener.call(this, e); listener.call(this, e);
}, this); }, this);
}.bind(this)); }.bind(this));
}, }
addEventListener: function addEventListener(name, listener) { }, {
key: 'addEventListener',
value: function addEventListener(name, listener) {
this._listeners.push(listener); this._listeners.push(listener);
}, }
removeEventListener: function removeEventListener(name, listener) { }, {
key: 'removeEventListener',
value: function removeEventListener(name, listener) {
var i = this._listeners.indexOf(listener); var i = this._listeners.indexOf(listener);
this._listeners.splice(i, 1); this._listeners.splice(i, 1);
}, }
terminate: function terminate() { }, {
key: 'terminate',
value: function terminate() {
this._listeners = []; this._listeners = [];
} }
}; }]);
return LoopbackPort;
}();
var PDFWorker = function PDFWorkerClosure() {
var nextFakeWorkerId = 0;
function getWorkerSrc() {
if (typeof workerSrc !== 'undefined') {
return workerSrc;
}
if ((0, _dom_utils.getDefaultSetting)('workerSrc')) {
return (0, _dom_utils.getDefaultSetting)('workerSrc');
}
if (pdfjsFilePath) {
return pdfjsFilePath.replace(/(\.(?:min\.)?js)(\?.*)?$/i, '.worker$1$2');
}
(0, _util.error)('No PDFJS.workerSrc specified');
}
var fakeWorkerFilesLoadedCapability;
function setupFakeWorkerGlobal() {
var WorkerMessageHandler;
if (fakeWorkerFilesLoadedCapability) {
return fakeWorkerFilesLoadedCapability.promise;
}
fakeWorkerFilesLoadedCapability = (0, _util.createPromiseCapability)();
var pdfjsCoreWorker = __w_pdfjs_require__(23);
__w_pdfjs_require__(39);
WorkerMessageHandler = pdfjsCoreWorker.WorkerMessageHandler;
fakeWorkerFilesLoadedCapability.resolve(WorkerMessageHandler);
return fakeWorkerFilesLoadedCapability.promise;
}
function createCDNWrapper(url) { function createCDNWrapper(url) {
var wrapper = 'importScripts(\'' + url + '\');'; var wrapper = 'importScripts(\'' + url + '\');';
return URL.createObjectURL(new Blob([wrapper])); return URL.createObjectURL(new Blob([wrapper]));
@ -12131,7 +12151,7 @@ var PDFWorker = function PDFWorkerClosure() {
return; return;
} }
var isTypedArraysPresent = Uint8Array !== Float32Array; var isTypedArraysPresent = Uint8Array !== Float32Array;
var port = new FakeWorkerPort(isTypedArraysPresent); var port = new LoopbackPort(isTypedArraysPresent);
this._port = port; this._port = port;
var id = 'fake' + nextFakeWorkerId++; var id = 'fake' + nextFakeWorkerId++;
var workerHandler = new _util.MessageHandler(id + '_worker', id, port); var workerHandler = new _util.MessageHandler(id + '_worker', id, port);
@ -12726,10 +12746,11 @@ var _UnsupportedManager = function UnsupportedManagerClosure() {
}(); }();
var version, build; var version, build;
{ {
exports.version = version = '1.8.292'; exports.version = version = '1.8.306';
exports.build = build = 'e18a08ff'; exports.build = build = '2ac41062';
} }
exports.getDocument = getDocument; exports.getDocument = getDocument;
exports.LoopbackPort = LoopbackPort;
exports.PDFDataRangeTransport = PDFDataRangeTransport; exports.PDFDataRangeTransport = PDFDataRangeTransport;
exports.PDFWorker = PDFWorker; exports.PDFWorker = PDFWorker;
exports.PDFDocumentProxy = PDFDocumentProxy; exports.PDFDocumentProxy = PDFDocumentProxy;
@ -16194,6 +16215,8 @@ var ChunkedStreamManager = function ChunkedStreamManagerClosure() {
return this._loadedStreamCapability.promise; return this._loadedStreamCapability.promise;
}, },
sendRequest: function ChunkedStreamManager_sendRequest(begin, end) { sendRequest: function ChunkedStreamManager_sendRequest(begin, end) {
var _this = this;
var rangeReader = this.pdfNetworkStream.getRangeReader(begin, end); var rangeReader = this.pdfNetworkStream.getRangeReader(begin, end);
if (!rangeReader.isStreamingSupported) { if (!rangeReader.isStreamingSupported) {
rangeReader.onProgress = this.onProgress.bind(this); rangeReader.onProgress = this.onProgress.bind(this);
@ -16224,14 +16247,14 @@ var ChunkedStreamManager = function ChunkedStreamManagerClosure() {
rangeReader.read().then(readChunk, reject); rangeReader.read().then(readChunk, reject);
}); });
promise.then(function (data) { promise.then(function (data) {
if (this.aborted) { if (_this.aborted) {
return; return;
} }
this.onReceiveData({ _this.onReceiveData({
chunk: data, chunk: data,
begin: begin begin: begin
}); });
}.bind(this)); });
}, },
requestAllChunks: function ChunkedStreamManager_requestAllChunks() { requestAllChunks: function ChunkedStreamManager_requestAllChunks() {
var missingChunks = this.stream.getMissingChunks(); var missingChunks = this.stream.getMissingChunks();
@ -22935,6 +22958,8 @@ exports.JpxImage = JpxImage;
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
var sharedUtil = __w_pdfjs_require__(0); var sharedUtil = __w_pdfjs_require__(0);
var corePrimitives = __w_pdfjs_require__(1); var corePrimitives = __w_pdfjs_require__(1);
var coreCrypto = __w_pdfjs_require__(17); var coreCrypto = __w_pdfjs_require__(17);
@ -23298,6 +23323,8 @@ var Catalog = function CatalogClosure() {
return shadow(this, 'javaScript', javaScript); return shadow(this, 'javaScript', javaScript);
}, },
cleanup: function Catalog_cleanup() { cleanup: function Catalog_cleanup() {
var _this = this;
this.pageKidsCountCache.clear(); this.pageKidsCountCache.clear();
var promises = []; var promises = [];
this.fontCache.forEach(function (promise) { this.fontCache.forEach(function (promise) {
@ -23308,17 +23335,21 @@ var Catalog = function CatalogClosure() {
var font = translatedFonts[i].dict; var font = translatedFonts[i].dict;
delete font.translated; delete font.translated;
} }
this.fontCache.clear(); _this.fontCache.clear();
this.builtInCMapCache = Object.create(null); _this.builtInCMapCache = Object.create(null);
}.bind(this)); });
}, },
getPage: function Catalog_getPage(pageIndex) { getPage: function Catalog_getPage(pageIndex) {
var _this2 = this;
if (!(pageIndex in this.pagePromises)) { if (!(pageIndex in this.pagePromises)) {
this.pagePromises[pageIndex] = this.getPageDict(pageIndex).then(function (a) { this.pagePromises[pageIndex] = this.getPageDict(pageIndex).then(function (_ref) {
var dict = a[0]; var _ref2 = _slicedToArray(_ref, 2),
var ref = a[1]; dict = _ref2[0],
return this.pageFactory.createPage(pageIndex, dict, ref, this.fontCache, this.builtInCMapCache); ref = _ref2[1];
}.bind(this));
return _this2.pageFactory.createPage(pageIndex, dict, ref, _this2.fontCache, _this2.builtInCMapCache);
});
} }
return this.pagePromises[pageIndex]; return this.pagePromises[pageIndex];
}, },
@ -24320,6 +24351,8 @@ var ObjectLoader = function () {
return this.capability.promise; return this.capability.promise;
}, },
_walk: function ObjectLoader_walk(nodesToVisit) { _walk: function ObjectLoader_walk(nodesToVisit) {
var _this3 = this;
var nodesToRevisit = []; var nodesToRevisit = [];
var pendingRequests = []; var pendingRequests = [];
while (nodesToVisit.length) { while (nodesToVisit.length) {
@ -24363,16 +24396,16 @@ var ObjectLoader = function () {
addChildren(currentNode, nodesToVisit); addChildren(currentNode, nodesToVisit);
} }
if (pendingRequests.length) { if (pendingRequests.length) {
this.xref.stream.manager.requestRanges(pendingRequests).then(function pendingRequestCallback() { this.xref.stream.manager.requestRanges(pendingRequests).then(function () {
nodesToVisit = nodesToRevisit; nodesToVisit = nodesToRevisit;
for (var i = 0; i < nodesToRevisit.length; i++) { for (var i = 0; i < nodesToRevisit.length; i++) {
var node = nodesToRevisit[i]; var node = nodesToRevisit[i];
if (isRef(node)) { if (isRef(node)) {
this.refSet.remove(node); _this3.refSet.remove(node);
} }
} }
this._walk(nodesToVisit); _this3._walk(nodesToVisit);
}.bind(this), this.capability.reject); }, this.capability.reject);
return; return;
} }
this.refSet = null; this.refSet = null;
@ -27153,7 +27186,7 @@ function setPDFNetworkStreamClass(cls) {
PDFNetworkStream = cls; PDFNetworkStream = cls;
} }
var WorkerMessageHandler = { var WorkerMessageHandler = {
setup: function wphSetup(handler, port) { setup: function setup(handler, port) {
var testMessageProcessed = false; var testMessageProcessed = false;
handler.on('test', function wphSetupTest(data) { handler.on('test', function wphSetupTest(data) {
if (testMessageProcessed) { if (testMessageProcessed) {
@ -27189,7 +27222,7 @@ var WorkerMessageHandler = {
return WorkerMessageHandler.createDocumentHandler(data, port); return WorkerMessageHandler.createDocumentHandler(data, port);
}); });
}, },
createDocumentHandler: function wphCreateDocumentHandler(docParams, port) { createDocumentHandler: function createDocumentHandler(docParams, port) {
var pdfManager; var pdfManager;
var terminated = false; var terminated = false;
var cancelXHRs = null; var cancelXHRs = null;
@ -27552,15 +27585,18 @@ var WorkerMessageHandler = {
docParams = null; docParams = null;
}); });
return workerHandlerName; return workerHandlerName;
},
initializeFromPort: function initializeFromPort(port) {
var handler = new MessageHandler('worker', 'main', port);
WorkerMessageHandler.setup(handler, port);
handler.send('ready', null);
} }
}; };
function initializeWorker() { function isMessagePort(maybePort) {
var handler = new MessageHandler('worker', 'main', self); return typeof maybePort.postMessage === 'function' && 'onmessage' in maybePort;
WorkerMessageHandler.setup(handler, self);
handler.send('ready', null);
} }
if (typeof window === 'undefined' && !isNodeJS()) { if (typeof window === 'undefined' && !isNodeJS() && typeof self !== 'undefined' && isMessagePort(self)) {
initializeWorker(); WorkerMessageHandler.initializeFromPort(self);
} }
exports.setPDFNetworkStreamClass = setPDFNetworkStreamClass; exports.setPDFNetworkStreamClass = setPDFNetworkStreamClass;
exports.WorkerTask = WorkerTask; exports.WorkerTask = WorkerTask;
@ -28049,8 +28085,8 @@ if (!_util.globalScope.PDFJS) {
} }
var PDFJS = _util.globalScope.PDFJS; var PDFJS = _util.globalScope.PDFJS;
{ {
PDFJS.version = '1.8.292'; PDFJS.version = '1.8.306';
PDFJS.build = 'e18a08ff'; PDFJS.build = '2ac41062';
} }
PDFJS.pdfBug = false; PDFJS.pdfBug = false;
if (PDFJS.verbosity !== undefined) { if (PDFJS.verbosity !== undefined) {
@ -28138,6 +28174,7 @@ PDFJS.pdfjsNext = PDFJS.pdfjsNext === undefined ? false : PDFJS.pdfjsNext;
} }
} }
PDFJS.getDocument = _api.getDocument; PDFJS.getDocument = _api.getDocument;
PDFJS.LoopbackPort = _api.LoopbackPort;
PDFJS.PDFDataRangeTransport = _api.PDFDataRangeTransport; PDFJS.PDFDataRangeTransport = _api.PDFDataRangeTransport;
PDFJS.PDFWorker = _api.PDFWorker; PDFJS.PDFWorker = _api.PDFWorker;
PDFJS.hasCanvasTypedArrays = true; PDFJS.hasCanvasTypedArrays = true;
@ -28398,20 +28435,19 @@ var Annotation = function AnnotationClosure() {
this.data.contents = stringToPDFString(dict.get('Contents') || ''); this.data.contents = stringToPDFString(dict.get('Contents') || '');
}, },
loadResources: function Annotation_loadResources(keys) { loadResources: function Annotation_loadResources(keys) {
return new Promise(function (resolve, reject) { return this.appearance.dict.getAsync('Resources').then(function (resources) {
this.appearance.dict.getAsync('Resources').then(function (resources) {
if (!resources) { if (!resources) {
resolve();
return; return;
} }
var objectLoader = new ObjectLoader(resources.map, keys, resources.xref); var objectLoader = new ObjectLoader(resources.map, keys, resources.xref);
objectLoader.load().then(function () { return objectLoader.load().then(function () {
resolve(resources); return resources;
}, reject); });
}, reject); });
}.bind(this));
}, },
getOperatorList: function Annotation_getOperatorList(evaluator, task, renderForms) { getOperatorList: function Annotation_getOperatorList(evaluator, task, renderForms) {
var _this = this;
if (!this.appearance) { if (!this.appearance) {
return Promise.resolve(new OperatorList()); return Promise.resolve(new OperatorList());
} }
@ -28421,13 +28457,12 @@ var Annotation = function AnnotationClosure() {
var bbox = appearanceDict.getArray('BBox') || [0, 0, 1, 1]; var bbox = appearanceDict.getArray('BBox') || [0, 0, 1, 1];
var matrix = appearanceDict.getArray('Matrix') || [1, 0, 0, 1, 0, 0]; var matrix = appearanceDict.getArray('Matrix') || [1, 0, 0, 1, 0, 0];
var transform = getTransformMatrix(data.rect, bbox, matrix); var transform = getTransformMatrix(data.rect, bbox, matrix);
var self = this;
return resourcesPromise.then(function (resources) { return resourcesPromise.then(function (resources) {
var opList = new OperatorList(); var opList = new OperatorList();
opList.addOp(OPS.beginAnnotation, [data.rect, transform, matrix]); opList.addOp(OPS.beginAnnotation, [data.rect, transform, matrix]);
return evaluator.getOperatorList(self.appearance, task, resources, opList).then(function () { return evaluator.getOperatorList(_this.appearance, task, resources, opList).then(function () {
opList.addOp(OPS.endAnnotation, []); opList.addOp(OPS.endAnnotation, []);
self.appearance.reset(); _this.appearance.reset();
return opList; return opList;
}); });
}); });
@ -29776,6 +29811,8 @@ exports.IdentityCMap = IdentityCMap;
"use strict"; "use strict";
var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
var sharedUtil = __w_pdfjs_require__(0); var sharedUtil = __w_pdfjs_require__(0);
var corePrimitives = __w_pdfjs_require__(1); var corePrimitives = __w_pdfjs_require__(1);
var coreStream = __w_pdfjs_require__(2); var coreStream = __w_pdfjs_require__(2);
@ -29937,37 +29974,44 @@ var Page = function PageClosure() {
return stream; return stream;
}, },
loadResources: function Page_loadResources(keys) { loadResources: function Page_loadResources(keys) {
var _this = this;
if (!this.resourcesPromise) { if (!this.resourcesPromise) {
this.resourcesPromise = this.pdfManager.ensure(this, 'resources'); this.resourcesPromise = this.pdfManager.ensure(this, 'resources');
} }
return this.resourcesPromise.then(function resourceSuccess() { return this.resourcesPromise.then(function () {
var objectLoader = new ObjectLoader(this.resources.map, keys, this.xref); var objectLoader = new ObjectLoader(_this.resources.map, keys, _this.xref);
return objectLoader.load(); return objectLoader.load();
}.bind(this)); });
}, },
getOperatorList: function Page_getOperatorList(handler, task, intent, renderInteractiveForms) { getOperatorList: function getOperatorList(handler, task, intent, renderInteractiveForms) {
var self = this; var _this2 = this;
var pdfManager = this.pdfManager; var pdfManager = this.pdfManager;
var contentStreamPromise = pdfManager.ensure(this, 'getContentStream', []); var contentStreamPromise = pdfManager.ensure(this, 'getContentStream', []);
var resourcesPromise = this.loadResources(['ExtGState', 'ColorSpace', 'Pattern', 'Shading', 'XObject', 'Font']); var resourcesPromise = this.loadResources(['ExtGState', 'ColorSpace', 'Pattern', 'Shading', 'XObject', 'Font']);
var partialEvaluator = new PartialEvaluator(pdfManager, this.xref, handler, this.pageIndex, this.idFactory, this.fontCache, this.builtInCMapCache, this.evaluatorOptions); var partialEvaluator = new PartialEvaluator(pdfManager, this.xref, handler, this.pageIndex, this.idFactory, this.fontCache, this.builtInCMapCache, this.evaluatorOptions);
var dataPromises = Promise.all([contentStreamPromise, resourcesPromise]); var dataPromises = Promise.all([contentStreamPromise, resourcesPromise]);
var pageListPromise = dataPromises.then(function (data) { var pageListPromise = dataPromises.then(function (_ref) {
var contentStream = data[0]; var _ref2 = _slicedToArray(_ref, 1),
var opList = new OperatorList(intent, handler, self.pageIndex); contentStream = _ref2[0];
var opList = new OperatorList(intent, handler, _this2.pageIndex);
handler.send('StartRenderPage', { handler.send('StartRenderPage', {
transparency: partialEvaluator.hasBlendModes(self.resources), transparency: partialEvaluator.hasBlendModes(_this2.resources),
pageIndex: self.pageIndex, pageIndex: _this2.pageIndex,
intent: intent intent: intent
}); });
return partialEvaluator.getOperatorList(contentStream, task, self.resources, opList).then(function () { return partialEvaluator.getOperatorList(contentStream, task, _this2.resources, opList).then(function () {
return opList; return opList;
}); });
}); });
var annotationsPromise = pdfManager.ensure(this, 'annotations'); var annotationsPromise = pdfManager.ensure(this, 'annotations');
return Promise.all([pageListPromise, annotationsPromise]).then(function (datas) { return Promise.all([pageListPromise, annotationsPromise]).then(function (_ref3) {
var pageOpList = datas[0]; var _ref4 = _slicedToArray(_ref3, 2),
var annotations = datas[1]; pageOpList = _ref4[0],
annotations = _ref4[1];
if (annotations.length === 0) { if (annotations.length === 0) {
pageOpList.flush(true); pageOpList.flush(true);
return pageOpList; return pageOpList;
@ -29991,18 +30035,22 @@ var Page = function PageClosure() {
}); });
}); });
}, },
extractTextContent: function Page_extractTextContent(handler, task, normalizeWhitespace, combineTextItems) { extractTextContent: function extractTextContent(handler, task, normalizeWhitespace, combineTextItems) {
var self = this; var _this3 = this;
var pdfManager = this.pdfManager; var pdfManager = this.pdfManager;
var contentStreamPromise = pdfManager.ensure(this, 'getContentStream', []); var contentStreamPromise = pdfManager.ensure(this, 'getContentStream', []);
var resourcesPromise = this.loadResources(['ExtGState', 'XObject', 'Font']); var resourcesPromise = this.loadResources(['ExtGState', 'XObject', 'Font']);
var dataPromises = Promise.all([contentStreamPromise, resourcesPromise]); var dataPromises = Promise.all([contentStreamPromise, resourcesPromise]);
return dataPromises.then(function (data) { return dataPromises.then(function (_ref5) {
var contentStream = data[0]; var _ref6 = _slicedToArray(_ref5, 1),
var partialEvaluator = new PartialEvaluator(pdfManager, self.xref, handler, self.pageIndex, self.idFactory, self.fontCache, self.builtInCMapCache, self.evaluatorOptions); contentStream = _ref6[0];
return partialEvaluator.getTextContent(contentStream, task, self.resources, null, normalizeWhitespace, combineTextItems);
var partialEvaluator = new PartialEvaluator(pdfManager, _this3.xref, handler, _this3.pageIndex, _this3.idFactory, _this3.fontCache, _this3.builtInCMapCache, _this3.evaluatorOptions);
return partialEvaluator.getTextContent(contentStream, task, _this3.resources, null, normalizeWhitespace, combineTextItems);
}); });
}, },
getAnnotationsData: function Page_getAnnotationsData(intent) { getAnnotationsData: function Page_getAnnotationsData(intent) {
var annotations = this.annotations; var annotations = this.annotations;
var annotationsData = []; var annotationsData = [];
@ -30191,12 +30239,12 @@ var PDFDocument = function PDFDocumentClosure() {
this.xref.setStartXRef(startXRef); this.xref.setStartXRef(startXRef);
}, },
setup: function PDFDocument_setup(recoveryMode) { setup: function PDFDocument_setup(recoveryMode) {
var _this = this; var _this4 = this;
this.xref.parse(recoveryMode); this.xref.parse(recoveryMode);
var pageFactory = { var pageFactory = {
createPage: function createPage(pageIndex, dict, ref, fontCache, builtInCMapCache) { createPage: function createPage(pageIndex, dict, ref, fontCache, builtInCMapCache) {
return new Page(_this.pdfManager, _this.xref, pageIndex, dict, ref, fontCache, builtInCMapCache); return new Page(_this4.pdfManager, _this4.xref, pageIndex, dict, ref, fontCache, builtInCMapCache);
} }
}; };
this.catalog = new Catalog(this.pdfManager, this.xref, pageFactory); this.catalog = new Catalog(this.pdfManager, this.xref, pageFactory);
@ -31340,6 +31388,8 @@ var OpenTypeFileBuilder = function OpenTypeFileBuilderClosure() {
var ProblematicCharRanges = new Int32Array([0x0000, 0x0020, 0x007F, 0x00A1, 0x00AD, 0x00AE, 0x0600, 0x0780, 0x08A0, 0x10A0, 0x1780, 0x1800, 0x1C00, 0x1C50, 0x2000, 0x2010, 0x2011, 0x2012, 0x2028, 0x2030, 0x205F, 0x2070, 0x25CC, 0x25CD, 0x3000, 0x3001, 0xAA60, 0xAA80, 0xFFF0, 0x10000]); var ProblematicCharRanges = new Int32Array([0x0000, 0x0020, 0x007F, 0x00A1, 0x00AD, 0x00AE, 0x0600, 0x0780, 0x08A0, 0x10A0, 0x1780, 0x1800, 0x1C00, 0x1C50, 0x2000, 0x2010, 0x2011, 0x2012, 0x2028, 0x2030, 0x205F, 0x2070, 0x25CC, 0x25CD, 0x3000, 0x3001, 0xAA60, 0xAA80, 0xFFF0, 0x10000]);
var Font = function FontClosure() { var Font = function FontClosure() {
function Font(name, file, properties) { function Font(name, file, properties) {
var _this = this;
var charCode, glyphName, unicode; var charCode, glyphName, unicode;
this.name = name; this.name = name;
this.loadedName = properties.loadedName; this.loadedName = properties.loadedName;
@ -31426,15 +31476,15 @@ var Font = function FontClosure() {
} else { } else {
glyphsUnicodeMap = getGlyphsUnicode(); glyphsUnicodeMap = getGlyphsUnicode();
this.toUnicode.forEach(function (charCode, unicodeCharCode) { this.toUnicode.forEach(function (charCode, unicodeCharCode) {
if (!this.composite) { if (!_this.composite) {
glyphName = properties.differences[charCode] || properties.defaultEncoding[charCode]; glyphName = properties.differences[charCode] || properties.defaultEncoding[charCode];
unicode = getUnicodeForGlyph(glyphName, glyphsUnicodeMap); unicode = getUnicodeForGlyph(glyphName, glyphsUnicodeMap);
if (unicode !== -1) { if (unicode !== -1) {
unicodeCharCode = unicode; unicodeCharCode = unicode;
} }
} }
this.toFontChar[charCode] = unicodeCharCode; _this.toFontChar[charCode] = unicodeCharCode;
}.bind(this)); });
} }
this.loadedName = fontName.split('-')[0]; this.loadedName = fontName.split('-')[0];
this.loading = false; this.loading = false;
@ -43575,8 +43625,8 @@ exports.TilingPattern = TilingPattern;
"use strict"; "use strict";
var pdfjsVersion = '1.8.292'; var pdfjsVersion = '1.8.306';
var pdfjsBuild = 'e18a08ff'; var pdfjsBuild = '2ac41062';
var pdfjsSharedUtil = __w_pdfjs_require__(0); var pdfjsSharedUtil = __w_pdfjs_require__(0);
var pdfjsDisplayGlobal = __w_pdfjs_require__(26); var pdfjsDisplayGlobal = __w_pdfjs_require__(26);
var pdfjsDisplayAPI = __w_pdfjs_require__(10); var pdfjsDisplayAPI = __w_pdfjs_require__(10);
@ -43588,6 +43638,7 @@ exports.PDFJS = pdfjsDisplayGlobal.PDFJS;
exports.build = pdfjsDisplayAPI.build; exports.build = pdfjsDisplayAPI.build;
exports.version = pdfjsDisplayAPI.version; exports.version = pdfjsDisplayAPI.version;
exports.getDocument = pdfjsDisplayAPI.getDocument; exports.getDocument = pdfjsDisplayAPI.getDocument;
exports.LoobpackPort = pdfjsDisplayAPI.LoopbackPort;
exports.PDFDataRangeTransport = pdfjsDisplayAPI.PDFDataRangeTransport; exports.PDFDataRangeTransport = pdfjsDisplayAPI.PDFDataRangeTransport;
exports.PDFWorker = pdfjsDisplayAPI.PDFWorker; exports.PDFWorker = pdfjsDisplayAPI.PDFWorker;
exports.renderTextLayer = pdfjsDisplayTextLayer.renderTextLayer; exports.renderTextLayer = pdfjsDisplayTextLayer.renderTextLayer;

115
build/pdf.js

@ -2086,7 +2086,9 @@ exports.AnnotationLayer = AnnotationLayer;
Object.defineProperty(exports, "__esModule", { Object.defineProperty(exports, "__esModule", {
value: true value: true
}); });
exports.build = exports.version = exports._UnsupportedManager = exports.PDFPageProxy = exports.PDFDocumentProxy = exports.PDFWorker = exports.PDFDataRangeTransport = exports.getDocument = undefined; exports.build = exports.version = exports._UnsupportedManager = exports.PDFPageProxy = exports.PDFDocumentProxy = exports.PDFWorker = exports.PDFDataRangeTransport = exports.LoopbackPort = exports.getDocument = undefined;
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
@ -2100,6 +2102,8 @@ var _canvas = __w_pdfjs_require__(10);
var _metadata = __w_pdfjs_require__(7); var _metadata = __w_pdfjs_require__(7);
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var DEFAULT_RANGE_CHUNK_SIZE = 65536; var DEFAULT_RANGE_CHUNK_SIZE = 65536;
var isWorkerDisabled = false; var isWorkerDisabled = false;
var workerSrc; var workerSrc;
@ -2615,42 +2619,19 @@ var PDFPageProxy = function PDFPageProxyClosure() {
}; };
return PDFPageProxy; return PDFPageProxy;
}(); }();
var PDFWorker = function PDFWorkerClosure() {
var nextFakeWorkerId = 0; var LoopbackPort = function () {
function getWorkerSrc() { function LoopbackPort(defer) {
if (typeof workerSrc !== 'undefined') { _classCallCheck(this, LoopbackPort);
return workerSrc;
}
if ((0, _dom_utils.getDefaultSetting)('workerSrc')) {
return (0, _dom_utils.getDefaultSetting)('workerSrc');
}
if (pdfjsFilePath) {
return pdfjsFilePath.replace(/(\.(?:min\.)?js)(\?.*)?$/i, '.worker$1$2');
}
(0, _util.error)('No PDFJS.workerSrc specified');
}
var fakeWorkerFilesLoadedCapability;
function setupFakeWorkerGlobal() {
var WorkerMessageHandler;
if (fakeWorkerFilesLoadedCapability) {
return fakeWorkerFilesLoadedCapability.promise;
}
fakeWorkerFilesLoadedCapability = (0, _util.createPromiseCapability)();
var loader = fakeWorkerFilesLoader || function (callback) {
_util.Util.loadScript(getWorkerSrc(), function () {
callback(window.pdfjsDistBuildPdfWorker.WorkerMessageHandler);
});
};
loader(fakeWorkerFilesLoadedCapability.resolve);
return fakeWorkerFilesLoadedCapability.promise;
}
function FakeWorkerPort(defer) {
this._listeners = []; this._listeners = [];
this._defer = defer; this._defer = defer;
this._deferred = Promise.resolve(undefined); this._deferred = Promise.resolve(undefined);
} }
FakeWorkerPort.prototype = {
postMessage: function postMessage(obj, transfers) { _createClass(LoopbackPort, [{
key: 'postMessage',
value: function postMessage(obj, transfers) {
function cloneValue(value) { function cloneValue(value) {
if ((typeof value === 'undefined' ? 'undefined' : _typeof(value)) !== 'object' || value === null) { if ((typeof value === 'undefined' ? 'undefined' : _typeof(value)) !== 'object' || value === null) {
return value; return value;
@ -2700,18 +2681,57 @@ var PDFWorker = function PDFWorkerClosure() {
listener.call(this, e); listener.call(this, e);
}, this); }, this);
}.bind(this)); }.bind(this));
}, }
addEventListener: function addEventListener(name, listener) { }, {
key: 'addEventListener',
value: function addEventListener(name, listener) {
this._listeners.push(listener); this._listeners.push(listener);
}, }
removeEventListener: function removeEventListener(name, listener) { }, {
key: 'removeEventListener',
value: function removeEventListener(name, listener) {
var i = this._listeners.indexOf(listener); var i = this._listeners.indexOf(listener);
this._listeners.splice(i, 1); this._listeners.splice(i, 1);
}, }
terminate: function terminate() { }, {
key: 'terminate',
value: function terminate() {
this._listeners = []; this._listeners = [];
} }
}]);
return LoopbackPort;
}();
var PDFWorker = function PDFWorkerClosure() {
var nextFakeWorkerId = 0;
function getWorkerSrc() {
if (typeof workerSrc !== 'undefined') {
return workerSrc;
}
if ((0, _dom_utils.getDefaultSetting)('workerSrc')) {
return (0, _dom_utils.getDefaultSetting)('workerSrc');
}
if (pdfjsFilePath) {
return pdfjsFilePath.replace(/(\.(?:min\.)?js)(\?.*)?$/i, '.worker$1$2');
}
(0, _util.error)('No PDFJS.workerSrc specified');
}
var fakeWorkerFilesLoadedCapability;
function setupFakeWorkerGlobal() {
var WorkerMessageHandler;
if (fakeWorkerFilesLoadedCapability) {
return fakeWorkerFilesLoadedCapability.promise;
}
fakeWorkerFilesLoadedCapability = (0, _util.createPromiseCapability)();
var loader = fakeWorkerFilesLoader || function (callback) {
_util.Util.loadScript(getWorkerSrc(), function () {
callback(window.pdfjsDistBuildPdfWorker.WorkerMessageHandler);
});
}; };
loader(fakeWorkerFilesLoadedCapability.resolve);
return fakeWorkerFilesLoadedCapability.promise;
}
function createCDNWrapper(url) { function createCDNWrapper(url) {
var wrapper = 'importScripts(\'' + url + '\');'; var wrapper = 'importScripts(\'' + url + '\');';
return URL.createObjectURL(new Blob([wrapper])); return URL.createObjectURL(new Blob([wrapper]));
@ -2840,7 +2860,7 @@ var PDFWorker = function PDFWorkerClosure() {
return; return;
} }
var isTypedArraysPresent = Uint8Array !== Float32Array; var isTypedArraysPresent = Uint8Array !== Float32Array;
var port = new FakeWorkerPort(isTypedArraysPresent); var port = new LoopbackPort(isTypedArraysPresent);
this._port = port; this._port = port;
var id = 'fake' + nextFakeWorkerId++; var id = 'fake' + nextFakeWorkerId++;
var workerHandler = new _util.MessageHandler(id + '_worker', id, port); var workerHandler = new _util.MessageHandler(id + '_worker', id, port);
@ -3435,10 +3455,11 @@ var _UnsupportedManager = function UnsupportedManagerClosure() {
}(); }();
var version, build; var version, build;
{ {
exports.version = version = '1.8.292'; exports.version = version = '1.8.306';
exports.build = build = 'e18a08ff'; exports.build = build = '2ac41062';
} }
exports.getDocument = getDocument; exports.getDocument = getDocument;
exports.LoopbackPort = LoopbackPort;
exports.PDFDataRangeTransport = PDFDataRangeTransport; exports.PDFDataRangeTransport = PDFDataRangeTransport;
exports.PDFWorker = PDFWorker; exports.PDFWorker = PDFWorker;
exports.PDFDocumentProxy = PDFDocumentProxy; exports.PDFDocumentProxy = PDFDocumentProxy;
@ -5403,8 +5424,8 @@ if (!_util.globalScope.PDFJS) {
} }
var PDFJS = _util.globalScope.PDFJS; var PDFJS = _util.globalScope.PDFJS;
{ {
PDFJS.version = '1.8.292'; PDFJS.version = '1.8.306';
PDFJS.build = 'e18a08ff'; PDFJS.build = '2ac41062';
} }
PDFJS.pdfBug = false; PDFJS.pdfBug = false;
if (PDFJS.verbosity !== undefined) { if (PDFJS.verbosity !== undefined) {
@ -5492,6 +5513,7 @@ PDFJS.pdfjsNext = PDFJS.pdfjsNext === undefined ? false : PDFJS.pdfjsNext;
} }
} }
PDFJS.getDocument = _api.getDocument; PDFJS.getDocument = _api.getDocument;
PDFJS.LoopbackPort = _api.LoopbackPort;
PDFJS.PDFDataRangeTransport = _api.PDFDataRangeTransport; PDFJS.PDFDataRangeTransport = _api.PDFDataRangeTransport;
PDFJS.PDFWorker = _api.PDFWorker; PDFJS.PDFWorker = _api.PDFWorker;
PDFJS.hasCanvasTypedArrays = true; PDFJS.hasCanvasTypedArrays = true;
@ -7898,8 +7920,8 @@ exports.TilingPattern = TilingPattern;
"use strict"; "use strict";
var pdfjsVersion = '1.8.292'; var pdfjsVersion = '1.8.306';
var pdfjsBuild = 'e18a08ff'; var pdfjsBuild = '2ac41062';
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);
@ -7911,6 +7933,7 @@ exports.PDFJS = pdfjsDisplayGlobal.PDFJS;
exports.build = pdfjsDisplayAPI.build; exports.build = pdfjsDisplayAPI.build;
exports.version = pdfjsDisplayAPI.version; exports.version = pdfjsDisplayAPI.version;
exports.getDocument = pdfjsDisplayAPI.getDocument; exports.getDocument = pdfjsDisplayAPI.getDocument;
exports.LoobpackPort = pdfjsDisplayAPI.LoopbackPort;
exports.PDFDataRangeTransport = pdfjsDisplayAPI.PDFDataRangeTransport; exports.PDFDataRangeTransport = pdfjsDisplayAPI.PDFDataRangeTransport;
exports.PDFWorker = pdfjsDisplayAPI.PDFWorker; exports.PDFWorker = pdfjsDisplayAPI.PDFWorker;
exports.renderTextLayer = pdfjsDisplayTextLayer.renderTextLayer; exports.renderTextLayer = pdfjsDisplayTextLayer.renderTextLayer;

12
build/pdf.min.js vendored

File diff suppressed because one or more lines are too long

150
build/pdf.worker.js vendored

@ -10840,7 +10840,7 @@ function setPDFNetworkStreamClass(cls) {
PDFNetworkStream = cls; PDFNetworkStream = cls;
} }
var WorkerMessageHandler = { var WorkerMessageHandler = {
setup: function wphSetup(handler, port) { setup: function setup(handler, port) {
var testMessageProcessed = false; var testMessageProcessed = false;
handler.on('test', function wphSetupTest(data) { handler.on('test', function wphSetupTest(data) {
if (testMessageProcessed) { if (testMessageProcessed) {
@ -10876,7 +10876,7 @@ var WorkerMessageHandler = {
return WorkerMessageHandler.createDocumentHandler(data, port); return WorkerMessageHandler.createDocumentHandler(data, port);
}); });
}, },
createDocumentHandler: function wphCreateDocumentHandler(docParams, port) { createDocumentHandler: function createDocumentHandler(docParams, port) {
var pdfManager; var pdfManager;
var terminated = false; var terminated = false;
var cancelXHRs = null; var cancelXHRs = null;
@ -11239,15 +11239,18 @@ var WorkerMessageHandler = {
docParams = null; docParams = null;
}); });
return workerHandlerName; return workerHandlerName;
},
initializeFromPort: function initializeFromPort(port) {
var handler = new MessageHandler('worker', 'main', port);
WorkerMessageHandler.setup(handler, port);
handler.send('ready', null);
} }
}; };
function initializeWorker() { function isMessagePort(maybePort) {
var handler = new MessageHandler('worker', 'main', self); return typeof maybePort.postMessage === 'function' && 'onmessage' in maybePort;
WorkerMessageHandler.setup(handler, self);
handler.send('ready', null);
} }
if (typeof window === 'undefined' && !isNodeJS()) { if (typeof window === 'undefined' && !isNodeJS() && typeof self !== 'undefined' && isMessagePort(self)) {
initializeWorker(); WorkerMessageHandler.initializeFromPort(self);
} }
exports.setPDFNetworkStreamClass = setPDFNetworkStreamClass; exports.setPDFNetworkStreamClass = setPDFNetworkStreamClass;
exports.WorkerTask = WorkerTask; exports.WorkerTask = WorkerTask;
@ -13257,6 +13260,8 @@ var ChunkedStreamManager = function ChunkedStreamManagerClosure() {
return this._loadedStreamCapability.promise; return this._loadedStreamCapability.promise;
}, },
sendRequest: function ChunkedStreamManager_sendRequest(begin, end) { sendRequest: function ChunkedStreamManager_sendRequest(begin, end) {
var _this = this;
var rangeReader = this.pdfNetworkStream.getRangeReader(begin, end); var rangeReader = this.pdfNetworkStream.getRangeReader(begin, end);
if (!rangeReader.isStreamingSupported) { if (!rangeReader.isStreamingSupported) {
rangeReader.onProgress = this.onProgress.bind(this); rangeReader.onProgress = this.onProgress.bind(this);
@ -13287,14 +13292,14 @@ var ChunkedStreamManager = function ChunkedStreamManagerClosure() {
rangeReader.read().then(readChunk, reject); rangeReader.read().then(readChunk, reject);
}); });
promise.then(function (data) { promise.then(function (data) {
if (this.aborted) { if (_this.aborted) {
return; return;
} }
this.onReceiveData({ _this.onReceiveData({
chunk: data, chunk: data,
begin: begin begin: begin
}); });
}.bind(this)); });
}, },
requestAllChunks: function ChunkedStreamManager_requestAllChunks() { requestAllChunks: function ChunkedStreamManager_requestAllChunks() {
var missingChunks = this.stream.getMissingChunks(); var missingChunks = this.stream.getMissingChunks();
@ -19998,6 +20003,8 @@ exports.JpxImage = JpxImage;
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
var sharedUtil = __w_pdfjs_require__(0); var sharedUtil = __w_pdfjs_require__(0);
var corePrimitives = __w_pdfjs_require__(1); var corePrimitives = __w_pdfjs_require__(1);
var coreCrypto = __w_pdfjs_require__(13); var coreCrypto = __w_pdfjs_require__(13);
@ -20361,6 +20368,8 @@ var Catalog = function CatalogClosure() {
return shadow(this, 'javaScript', javaScript); return shadow(this, 'javaScript', javaScript);
}, },
cleanup: function Catalog_cleanup() { cleanup: function Catalog_cleanup() {
var _this = this;
this.pageKidsCountCache.clear(); this.pageKidsCountCache.clear();
var promises = []; var promises = [];
this.fontCache.forEach(function (promise) { this.fontCache.forEach(function (promise) {
@ -20371,17 +20380,21 @@ var Catalog = function CatalogClosure() {
var font = translatedFonts[i].dict; var font = translatedFonts[i].dict;
delete font.translated; delete font.translated;
} }
this.fontCache.clear(); _this.fontCache.clear();
this.builtInCMapCache = Object.create(null); _this.builtInCMapCache = Object.create(null);
}.bind(this)); });
}, },
getPage: function Catalog_getPage(pageIndex) { getPage: function Catalog_getPage(pageIndex) {
var _this2 = this;
if (!(pageIndex in this.pagePromises)) { if (!(pageIndex in this.pagePromises)) {
this.pagePromises[pageIndex] = this.getPageDict(pageIndex).then(function (a) { this.pagePromises[pageIndex] = this.getPageDict(pageIndex).then(function (_ref) {
var dict = a[0]; var _ref2 = _slicedToArray(_ref, 2),
var ref = a[1]; dict = _ref2[0],
return this.pageFactory.createPage(pageIndex, dict, ref, this.fontCache, this.builtInCMapCache); ref = _ref2[1];
}.bind(this));
return _this2.pageFactory.createPage(pageIndex, dict, ref, _this2.fontCache, _this2.builtInCMapCache);
});
} }
return this.pagePromises[pageIndex]; return this.pagePromises[pageIndex];
}, },
@ -21383,6 +21396,8 @@ var ObjectLoader = function () {
return this.capability.promise; return this.capability.promise;
}, },
_walk: function ObjectLoader_walk(nodesToVisit) { _walk: function ObjectLoader_walk(nodesToVisit) {
var _this3 = this;
var nodesToRevisit = []; var nodesToRevisit = [];
var pendingRequests = []; var pendingRequests = [];
while (nodesToVisit.length) { while (nodesToVisit.length) {
@ -21426,16 +21441,16 @@ var ObjectLoader = function () {
addChildren(currentNode, nodesToVisit); addChildren(currentNode, nodesToVisit);
} }
if (pendingRequests.length) { if (pendingRequests.length) {
this.xref.stream.manager.requestRanges(pendingRequests).then(function pendingRequestCallback() { this.xref.stream.manager.requestRanges(pendingRequests).then(function () {
nodesToVisit = nodesToRevisit; nodesToVisit = nodesToRevisit;
for (var i = 0; i < nodesToRevisit.length; i++) { for (var i = 0; i < nodesToRevisit.length; i++) {
var node = nodesToRevisit[i]; var node = nodesToRevisit[i];
if (isRef(node)) { if (isRef(node)) {
this.refSet.remove(node); _this3.refSet.remove(node);
} }
} }
this._walk(nodesToVisit); _this3._walk(nodesToVisit);
}.bind(this), this.capability.reject); }, this.capability.reject);
return; return;
} }
this.refSet = null; this.refSet = null;
@ -24687,20 +24702,19 @@ var Annotation = function AnnotationClosure() {
this.data.contents = stringToPDFString(dict.get('Contents') || ''); this.data.contents = stringToPDFString(dict.get('Contents') || '');
}, },
loadResources: function Annotation_loadResources(keys) { loadResources: function Annotation_loadResources(keys) {
return new Promise(function (resolve, reject) { return this.appearance.dict.getAsync('Resources').then(function (resources) {
this.appearance.dict.getAsync('Resources').then(function (resources) {
if (!resources) { if (!resources) {
resolve();
return; return;
} }
var objectLoader = new ObjectLoader(resources.map, keys, resources.xref); var objectLoader = new ObjectLoader(resources.map, keys, resources.xref);
objectLoader.load().then(function () { return objectLoader.load().then(function () {
resolve(resources); return resources;
}, reject); });
}, reject); });
}.bind(this));
}, },
getOperatorList: function Annotation_getOperatorList(evaluator, task, renderForms) { getOperatorList: function Annotation_getOperatorList(evaluator, task, renderForms) {
var _this = this;
if (!this.appearance) { if (!this.appearance) {
return Promise.resolve(new OperatorList()); return Promise.resolve(new OperatorList());
} }
@ -24710,13 +24724,12 @@ var Annotation = function AnnotationClosure() {
var bbox = appearanceDict.getArray('BBox') || [0, 0, 1, 1]; var bbox = appearanceDict.getArray('BBox') || [0, 0, 1, 1];
var matrix = appearanceDict.getArray('Matrix') || [1, 0, 0, 1, 0, 0]; var matrix = appearanceDict.getArray('Matrix') || [1, 0, 0, 1, 0, 0];
var transform = getTransformMatrix(data.rect, bbox, matrix); var transform = getTransformMatrix(data.rect, bbox, matrix);
var self = this;
return resourcesPromise.then(function (resources) { return resourcesPromise.then(function (resources) {
var opList = new OperatorList(); var opList = new OperatorList();
opList.addOp(OPS.beginAnnotation, [data.rect, transform, matrix]); opList.addOp(OPS.beginAnnotation, [data.rect, transform, matrix]);
return evaluator.getOperatorList(self.appearance, task, resources, opList).then(function () { return evaluator.getOperatorList(_this.appearance, task, resources, opList).then(function () {
opList.addOp(OPS.endAnnotation, []); opList.addOp(OPS.endAnnotation, []);
self.appearance.reset(); _this.appearance.reset();
return opList; return opList;
}); });
}); });
@ -26065,6 +26078,8 @@ exports.IdentityCMap = IdentityCMap;
"use strict"; "use strict";
var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
var sharedUtil = __w_pdfjs_require__(0); var sharedUtil = __w_pdfjs_require__(0);
var corePrimitives = __w_pdfjs_require__(1); var corePrimitives = __w_pdfjs_require__(1);
var coreStream = __w_pdfjs_require__(2); var coreStream = __w_pdfjs_require__(2);
@ -26226,37 +26241,44 @@ var Page = function PageClosure() {
return stream; return stream;
}, },
loadResources: function Page_loadResources(keys) { loadResources: function Page_loadResources(keys) {
var _this = this;
if (!this.resourcesPromise) { if (!this.resourcesPromise) {
this.resourcesPromise = this.pdfManager.ensure(this, 'resources'); this.resourcesPromise = this.pdfManager.ensure(this, 'resources');
} }
return this.resourcesPromise.then(function resourceSuccess() { return this.resourcesPromise.then(function () {
var objectLoader = new ObjectLoader(this.resources.map, keys, this.xref); var objectLoader = new ObjectLoader(_this.resources.map, keys, _this.xref);
return objectLoader.load(); return objectLoader.load();
}.bind(this)); });
}, },
getOperatorList: function Page_getOperatorList(handler, task, intent, renderInteractiveForms) { getOperatorList: function getOperatorList(handler, task, intent, renderInteractiveForms) {
var self = this; var _this2 = this;
var pdfManager = this.pdfManager; var pdfManager = this.pdfManager;
var contentStreamPromise = pdfManager.ensure(this, 'getContentStream', []); var contentStreamPromise = pdfManager.ensure(this, 'getContentStream', []);
var resourcesPromise = this.loadResources(['ExtGState', 'ColorSpace', 'Pattern', 'Shading', 'XObject', 'Font']); var resourcesPromise = this.loadResources(['ExtGState', 'ColorSpace', 'Pattern', 'Shading', 'XObject', 'Font']);
var partialEvaluator = new PartialEvaluator(pdfManager, this.xref, handler, this.pageIndex, this.idFactory, this.fontCache, this.builtInCMapCache, this.evaluatorOptions); var partialEvaluator = new PartialEvaluator(pdfManager, this.xref, handler, this.pageIndex, this.idFactory, this.fontCache, this.builtInCMapCache, this.evaluatorOptions);
var dataPromises = Promise.all([contentStreamPromise, resourcesPromise]); var dataPromises = Promise.all([contentStreamPromise, resourcesPromise]);
var pageListPromise = dataPromises.then(function (data) { var pageListPromise = dataPromises.then(function (_ref) {
var contentStream = data[0]; var _ref2 = _slicedToArray(_ref, 1),
var opList = new OperatorList(intent, handler, self.pageIndex); contentStream = _ref2[0];
var opList = new OperatorList(intent, handler, _this2.pageIndex);
handler.send('StartRenderPage', { handler.send('StartRenderPage', {
transparency: partialEvaluator.hasBlendModes(self.resources), transparency: partialEvaluator.hasBlendModes(_this2.resources),
pageIndex: self.pageIndex, pageIndex: _this2.pageIndex,
intent: intent intent: intent
}); });
return partialEvaluator.getOperatorList(contentStream, task, self.resources, opList).then(function () { return partialEvaluator.getOperatorList(contentStream, task, _this2.resources, opList).then(function () {
return opList; return opList;
}); });
}); });
var annotationsPromise = pdfManager.ensure(this, 'annotations'); var annotationsPromise = pdfManager.ensure(this, 'annotations');
return Promise.all([pageListPromise, annotationsPromise]).then(function (datas) { return Promise.all([pageListPromise, annotationsPromise]).then(function (_ref3) {
var pageOpList = datas[0]; var _ref4 = _slicedToArray(_ref3, 2),
var annotations = datas[1]; pageOpList = _ref4[0],
annotations = _ref4[1];
if (annotations.length === 0) { if (annotations.length === 0) {
pageOpList.flush(true); pageOpList.flush(true);
return pageOpList; return pageOpList;
@ -26280,18 +26302,22 @@ var Page = function PageClosure() {
}); });
}); });
}, },
extractTextContent: function Page_extractTextContent(handler, task, normalizeWhitespace, combineTextItems) { extractTextContent: function extractTextContent(handler, task, normalizeWhitespace, combineTextItems) {
var self = this; var _this3 = this;
var pdfManager = this.pdfManager; var pdfManager = this.pdfManager;
var contentStreamPromise = pdfManager.ensure(this, 'getContentStream', []); var contentStreamPromise = pdfManager.ensure(this, 'getContentStream', []);
var resourcesPromise = this.loadResources(['ExtGState', 'XObject', 'Font']); var resourcesPromise = this.loadResources(['ExtGState', 'XObject', 'Font']);
var dataPromises = Promise.all([contentStreamPromise, resourcesPromise]); var dataPromises = Promise.all([contentStreamPromise, resourcesPromise]);
return dataPromises.then(function (data) { return dataPromises.then(function (_ref5) {
var contentStream = data[0]; var _ref6 = _slicedToArray(_ref5, 1),
var partialEvaluator = new PartialEvaluator(pdfManager, self.xref, handler, self.pageIndex, self.idFactory, self.fontCache, self.builtInCMapCache, self.evaluatorOptions); contentStream = _ref6[0];
return partialEvaluator.getTextContent(contentStream, task, self.resources, null, normalizeWhitespace, combineTextItems);
var partialEvaluator = new PartialEvaluator(pdfManager, _this3.xref, handler, _this3.pageIndex, _this3.idFactory, _this3.fontCache, _this3.builtInCMapCache, _this3.evaluatorOptions);
return partialEvaluator.getTextContent(contentStream, task, _this3.resources, null, normalizeWhitespace, combineTextItems);
}); });
}, },
getAnnotationsData: function Page_getAnnotationsData(intent) { getAnnotationsData: function Page_getAnnotationsData(intent) {
var annotations = this.annotations; var annotations = this.annotations;
var annotationsData = []; var annotationsData = [];
@ -26480,12 +26506,12 @@ var PDFDocument = function PDFDocumentClosure() {
this.xref.setStartXRef(startXRef); this.xref.setStartXRef(startXRef);
}, },
setup: function PDFDocument_setup(recoveryMode) { setup: function PDFDocument_setup(recoveryMode) {
var _this = this; var _this4 = this;
this.xref.parse(recoveryMode); this.xref.parse(recoveryMode);
var pageFactory = { var pageFactory = {
createPage: function createPage(pageIndex, dict, ref, fontCache, builtInCMapCache) { createPage: function createPage(pageIndex, dict, ref, fontCache, builtInCMapCache) {
return new Page(_this.pdfManager, _this.xref, pageIndex, dict, ref, fontCache, builtInCMapCache); return new Page(_this4.pdfManager, _this4.xref, pageIndex, dict, ref, fontCache, builtInCMapCache);
} }
}; };
this.catalog = new Catalog(this.pdfManager, this.xref, pageFactory); this.catalog = new Catalog(this.pdfManager, this.xref, pageFactory);
@ -27629,6 +27655,8 @@ var OpenTypeFileBuilder = function OpenTypeFileBuilderClosure() {
var ProblematicCharRanges = new Int32Array([0x0000, 0x0020, 0x007F, 0x00A1, 0x00AD, 0x00AE, 0x0600, 0x0780, 0x08A0, 0x10A0, 0x1780, 0x1800, 0x1C00, 0x1C50, 0x2000, 0x2010, 0x2011, 0x2012, 0x2028, 0x2030, 0x205F, 0x2070, 0x25CC, 0x25CD, 0x3000, 0x3001, 0xAA60, 0xAA80, 0xFFF0, 0x10000]); var ProblematicCharRanges = new Int32Array([0x0000, 0x0020, 0x007F, 0x00A1, 0x00AD, 0x00AE, 0x0600, 0x0780, 0x08A0, 0x10A0, 0x1780, 0x1800, 0x1C00, 0x1C50, 0x2000, 0x2010, 0x2011, 0x2012, 0x2028, 0x2030, 0x205F, 0x2070, 0x25CC, 0x25CD, 0x3000, 0x3001, 0xAA60, 0xAA80, 0xFFF0, 0x10000]);
var Font = function FontClosure() { var Font = function FontClosure() {
function Font(name, file, properties) { function Font(name, file, properties) {
var _this = this;
var charCode, glyphName, unicode; var charCode, glyphName, unicode;
this.name = name; this.name = name;
this.loadedName = properties.loadedName; this.loadedName = properties.loadedName;
@ -27715,15 +27743,15 @@ var Font = function FontClosure() {
} else { } else {
glyphsUnicodeMap = getGlyphsUnicode(); glyphsUnicodeMap = getGlyphsUnicode();
this.toUnicode.forEach(function (charCode, unicodeCharCode) { this.toUnicode.forEach(function (charCode, unicodeCharCode) {
if (!this.composite) { if (!_this.composite) {
glyphName = properties.differences[charCode] || properties.defaultEncoding[charCode]; glyphName = properties.differences[charCode] || properties.defaultEncoding[charCode];
unicode = getUnicodeForGlyph(glyphName, glyphsUnicodeMap); unicode = getUnicodeForGlyph(glyphName, glyphsUnicodeMap);
if (unicode !== -1) { if (unicode !== -1) {
unicodeCharCode = unicode; unicodeCharCode = unicode;
} }
} }
this.toFontChar[charCode] = unicodeCharCode; _this.toFontChar[charCode] = unicodeCharCode;
}.bind(this)); });
} }
this.loadedName = fontName.split('-')[0]; this.loadedName = fontName.split('-')[0];
this.loading = false; this.loading = false;
@ -36988,8 +37016,8 @@ exports.Type1Parser = Type1Parser;
"use strict"; "use strict";
var pdfjsVersion = '1.8.292'; var pdfjsVersion = '1.8.306';
var pdfjsBuild = 'e18a08ff'; var pdfjsBuild = '2ac41062';
var pdfjsCoreWorker = __w_pdfjs_require__(8); var pdfjsCoreWorker = __w_pdfjs_require__(8);
{ {
__w_pdfjs_require__(19); __w_pdfjs_require__(19);

28
build/pdf.worker.min.js vendored

File diff suppressed because one or more lines are too long

20
lib/core/annotation.js

@ -250,20 +250,19 @@ var Annotation = function AnnotationClosure() {
this.data.contents = stringToPDFString(dict.get('Contents') || ''); this.data.contents = stringToPDFString(dict.get('Contents') || '');
}, },
loadResources: function Annotation_loadResources(keys) { loadResources: function Annotation_loadResources(keys) {
return new Promise(function (resolve, reject) { return this.appearance.dict.getAsync('Resources').then(function (resources) {
this.appearance.dict.getAsync('Resources').then(function (resources) {
if (!resources) { if (!resources) {
resolve();
return; return;
} }
var objectLoader = new ObjectLoader(resources.map, keys, resources.xref); var objectLoader = new ObjectLoader(resources.map, keys, resources.xref);
objectLoader.load().then(function () { return objectLoader.load().then(function () {
resolve(resources); return resources;
}, reject); });
}, reject); });
}.bind(this));
}, },
getOperatorList: function Annotation_getOperatorList(evaluator, task, renderForms) { getOperatorList: function Annotation_getOperatorList(evaluator, task, renderForms) {
var _this = this;
if (!this.appearance) { if (!this.appearance) {
return Promise.resolve(new OperatorList()); return Promise.resolve(new OperatorList());
} }
@ -273,13 +272,12 @@ var Annotation = function AnnotationClosure() {
var bbox = appearanceDict.getArray('BBox') || [0, 0, 1, 1]; var bbox = appearanceDict.getArray('BBox') || [0, 0, 1, 1];
var matrix = appearanceDict.getArray('Matrix') || [1, 0, 0, 1, 0, 0]; var matrix = appearanceDict.getArray('Matrix') || [1, 0, 0, 1, 0, 0];
var transform = getTransformMatrix(data.rect, bbox, matrix); var transform = getTransformMatrix(data.rect, bbox, matrix);
var self = this;
return resourcesPromise.then(function (resources) { return resourcesPromise.then(function (resources) {
var opList = new OperatorList(); var opList = new OperatorList();
opList.addOp(OPS.beginAnnotation, [data.rect, transform, matrix]); opList.addOp(OPS.beginAnnotation, [data.rect, transform, matrix]);
return evaluator.getOperatorList(self.appearance, task, resources, opList).then(function () { return evaluator.getOperatorList(_this.appearance, task, resources, opList).then(function () {
opList.addOp(OPS.endAnnotation, []); opList.addOp(OPS.endAnnotation, []);
self.appearance.reset(); _this.appearance.reset();
return opList; return opList;
}); });
}); });

8
lib/core/chunked_stream.js

@ -244,6 +244,8 @@ var ChunkedStreamManager = function ChunkedStreamManagerClosure() {
return this._loadedStreamCapability.promise; return this._loadedStreamCapability.promise;
}, },
sendRequest: function ChunkedStreamManager_sendRequest(begin, end) { sendRequest: function ChunkedStreamManager_sendRequest(begin, end) {
var _this = this;
var rangeReader = this.pdfNetworkStream.getRangeReader(begin, end); var rangeReader = this.pdfNetworkStream.getRangeReader(begin, end);
if (!rangeReader.isStreamingSupported) { if (!rangeReader.isStreamingSupported) {
rangeReader.onProgress = this.onProgress.bind(this); rangeReader.onProgress = this.onProgress.bind(this);
@ -274,14 +276,14 @@ var ChunkedStreamManager = function ChunkedStreamManagerClosure() {
rangeReader.read().then(readChunk, reject); rangeReader.read().then(readChunk, reject);
}); });
promise.then(function (data) { promise.then(function (data) {
if (this.aborted) { if (_this.aborted) {
return; return;
} }
this.onReceiveData({ _this.onReceiveData({
chunk: data, chunk: data,
begin: begin begin: begin
}); });
}.bind(this)); });
}, },
requestAllChunks: function ChunkedStreamManager_requestAllChunks() { requestAllChunks: function ChunkedStreamManager_requestAllChunks() {
var missingChunks = this.stream.getMissingChunks(); var missingChunks = this.stream.getMissingChunks();

57
lib/core/document.js

@ -14,6 +14,8 @@
*/ */
'use strict'; 'use strict';
var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
var sharedUtil = require('../shared/util.js'); var sharedUtil = require('../shared/util.js');
var corePrimitives = require('./primitives.js'); var corePrimitives = require('./primitives.js');
var coreStream = require('./stream.js'); var coreStream = require('./stream.js');
@ -175,37 +177,44 @@ var Page = function PageClosure() {
return stream; return stream;
}, },
loadResources: function Page_loadResources(keys) { loadResources: function Page_loadResources(keys) {
var _this = this;
if (!this.resourcesPromise) { if (!this.resourcesPromise) {
this.resourcesPromise = this.pdfManager.ensure(this, 'resources'); this.resourcesPromise = this.pdfManager.ensure(this, 'resources');
} }
return this.resourcesPromise.then(function resourceSuccess() { return this.resourcesPromise.then(function () {
var objectLoader = new ObjectLoader(this.resources.map, keys, this.xref); var objectLoader = new ObjectLoader(_this.resources.map, keys, _this.xref);
return objectLoader.load(); return objectLoader.load();
}.bind(this)); });
}, },
getOperatorList: function Page_getOperatorList(handler, task, intent, renderInteractiveForms) { getOperatorList: function getOperatorList(handler, task, intent, renderInteractiveForms) {
var self = this; var _this2 = this;
var pdfManager = this.pdfManager; var pdfManager = this.pdfManager;
var contentStreamPromise = pdfManager.ensure(this, 'getContentStream', []); var contentStreamPromise = pdfManager.ensure(this, 'getContentStream', []);
var resourcesPromise = this.loadResources(['ExtGState', 'ColorSpace', 'Pattern', 'Shading', 'XObject', 'Font']); var resourcesPromise = this.loadResources(['ExtGState', 'ColorSpace', 'Pattern', 'Shading', 'XObject', 'Font']);
var partialEvaluator = new PartialEvaluator(pdfManager, this.xref, handler, this.pageIndex, this.idFactory, this.fontCache, this.builtInCMapCache, this.evaluatorOptions); var partialEvaluator = new PartialEvaluator(pdfManager, this.xref, handler, this.pageIndex, this.idFactory, this.fontCache, this.builtInCMapCache, this.evaluatorOptions);
var dataPromises = Promise.all([contentStreamPromise, resourcesPromise]); var dataPromises = Promise.all([contentStreamPromise, resourcesPromise]);
var pageListPromise = dataPromises.then(function (data) { var pageListPromise = dataPromises.then(function (_ref) {
var contentStream = data[0]; var _ref2 = _slicedToArray(_ref, 1),
var opList = new OperatorList(intent, handler, self.pageIndex); contentStream = _ref2[0];
var opList = new OperatorList(intent, handler, _this2.pageIndex);
handler.send('StartRenderPage', { handler.send('StartRenderPage', {
transparency: partialEvaluator.hasBlendModes(self.resources), transparency: partialEvaluator.hasBlendModes(_this2.resources),
pageIndex: self.pageIndex, pageIndex: _this2.pageIndex,
intent: intent intent: intent
}); });
return partialEvaluator.getOperatorList(contentStream, task, self.resources, opList).then(function () { return partialEvaluator.getOperatorList(contentStream, task, _this2.resources, opList).then(function () {
return opList; return opList;
}); });
}); });
var annotationsPromise = pdfManager.ensure(this, 'annotations'); var annotationsPromise = pdfManager.ensure(this, 'annotations');
return Promise.all([pageListPromise, annotationsPromise]).then(function (datas) { return Promise.all([pageListPromise, annotationsPromise]).then(function (_ref3) {
var pageOpList = datas[0]; var _ref4 = _slicedToArray(_ref3, 2),
var annotations = datas[1]; pageOpList = _ref4[0],
annotations = _ref4[1];
if (annotations.length === 0) { if (annotations.length === 0) {
pageOpList.flush(true); pageOpList.flush(true);
return pageOpList; return pageOpList;
@ -229,18 +238,22 @@ var Page = function PageClosure() {
}); });
}); });
}, },
extractTextContent: function Page_extractTextContent(handler, task, normalizeWhitespace, combineTextItems) { extractTextContent: function extractTextContent(handler, task, normalizeWhitespace, combineTextItems) {
var self = this; var _this3 = this;
var pdfManager = this.pdfManager; var pdfManager = this.pdfManager;
var contentStreamPromise = pdfManager.ensure(this, 'getContentStream', []); var contentStreamPromise = pdfManager.ensure(this, 'getContentStream', []);
var resourcesPromise = this.loadResources(['ExtGState', 'XObject', 'Font']); var resourcesPromise = this.loadResources(['ExtGState', 'XObject', 'Font']);
var dataPromises = Promise.all([contentStreamPromise, resourcesPromise]); var dataPromises = Promise.all([contentStreamPromise, resourcesPromise]);
return dataPromises.then(function (data) { return dataPromises.then(function (_ref5) {
var contentStream = data[0]; var _ref6 = _slicedToArray(_ref5, 1),
var partialEvaluator = new PartialEvaluator(pdfManager, self.xref, handler, self.pageIndex, self.idFactory, self.fontCache, self.builtInCMapCache, self.evaluatorOptions); contentStream = _ref6[0];
return partialEvaluator.getTextContent(contentStream, task, self.resources, null, normalizeWhitespace, combineTextItems);
var partialEvaluator = new PartialEvaluator(pdfManager, _this3.xref, handler, _this3.pageIndex, _this3.idFactory, _this3.fontCache, _this3.builtInCMapCache, _this3.evaluatorOptions);
return partialEvaluator.getTextContent(contentStream, task, _this3.resources, null, normalizeWhitespace, combineTextItems);
}); });
}, },
getAnnotationsData: function Page_getAnnotationsData(intent) { getAnnotationsData: function Page_getAnnotationsData(intent) {
var annotations = this.annotations; var annotations = this.annotations;
var annotationsData = []; var annotationsData = [];
@ -429,12 +442,12 @@ var PDFDocument = function PDFDocumentClosure() {
this.xref.setStartXRef(startXRef); this.xref.setStartXRef(startXRef);
}, },
setup: function PDFDocument_setup(recoveryMode) { setup: function PDFDocument_setup(recoveryMode) {
var _this = this; var _this4 = this;
this.xref.parse(recoveryMode); this.xref.parse(recoveryMode);
var pageFactory = { var pageFactory = {
createPage: function createPage(pageIndex, dict, ref, fontCache, builtInCMapCache) { createPage: function createPage(pageIndex, dict, ref, fontCache, builtInCMapCache) {
return new Page(_this.pdfManager, _this.xref, pageIndex, dict, ref, fontCache, builtInCMapCache); return new Page(_this4.pdfManager, _this4.xref, pageIndex, dict, ref, fontCache, builtInCMapCache);
} }
}; };
this.catalog = new Catalog(this.pdfManager, this.xref, pageFactory); this.catalog = new Catalog(this.pdfManager, this.xref, pageFactory);

8
lib/core/fonts.js

@ -343,6 +343,8 @@ var OpenTypeFileBuilder = function OpenTypeFileBuilderClosure() {
var ProblematicCharRanges = new Int32Array([0x0000, 0x0020, 0x007F, 0x00A1, 0x00AD, 0x00AE, 0x0600, 0x0780, 0x08A0, 0x10A0, 0x1780, 0x1800, 0x1C00, 0x1C50, 0x2000, 0x2010, 0x2011, 0x2012, 0x2028, 0x2030, 0x205F, 0x2070, 0x25CC, 0x25CD, 0x3000, 0x3001, 0xAA60, 0xAA80, 0xFFF0, 0x10000]); var ProblematicCharRanges = new Int32Array([0x0000, 0x0020, 0x007F, 0x00A1, 0x00AD, 0x00AE, 0x0600, 0x0780, 0x08A0, 0x10A0, 0x1780, 0x1800, 0x1C00, 0x1C50, 0x2000, 0x2010, 0x2011, 0x2012, 0x2028, 0x2030, 0x205F, 0x2070, 0x25CC, 0x25CD, 0x3000, 0x3001, 0xAA60, 0xAA80, 0xFFF0, 0x10000]);
var Font = function FontClosure() { var Font = function FontClosure() {
function Font(name, file, properties) { function Font(name, file, properties) {
var _this = this;
var charCode, glyphName, unicode; var charCode, glyphName, unicode;
this.name = name; this.name = name;
this.loadedName = properties.loadedName; this.loadedName = properties.loadedName;
@ -429,15 +431,15 @@ var Font = function FontClosure() {
} else { } else {
glyphsUnicodeMap = getGlyphsUnicode(); glyphsUnicodeMap = getGlyphsUnicode();
this.toUnicode.forEach(function (charCode, unicodeCharCode) { this.toUnicode.forEach(function (charCode, unicodeCharCode) {
if (!this.composite) { if (!_this.composite) {
glyphName = properties.differences[charCode] || properties.defaultEncoding[charCode]; glyphName = properties.differences[charCode] || properties.defaultEncoding[charCode];
unicode = getUnicodeForGlyph(glyphName, glyphsUnicodeMap); unicode = getUnicodeForGlyph(glyphName, glyphsUnicodeMap);
if (unicode !== -1) { if (unicode !== -1) {
unicodeCharCode = unicode; unicodeCharCode = unicode;
} }
} }
this.toFontChar[charCode] = unicodeCharCode; _this.toFontChar[charCode] = unicodeCharCode;
}.bind(this)); });
} }
this.loadedName = fontName.split('-')[0]; this.loadedName = fontName.split('-')[0];
this.loading = false; this.loading = false;

34
lib/core/obj.js

@ -16,6 +16,8 @@
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
var sharedUtil = require('../shared/util.js'); var sharedUtil = require('../shared/util.js');
var corePrimitives = require('./primitives.js'); var corePrimitives = require('./primitives.js');
var coreCrypto = require('./crypto.js'); var coreCrypto = require('./crypto.js');
@ -379,6 +381,8 @@ var Catalog = function CatalogClosure() {
return shadow(this, 'javaScript', javaScript); return shadow(this, 'javaScript', javaScript);
}, },
cleanup: function Catalog_cleanup() { cleanup: function Catalog_cleanup() {
var _this = this;
this.pageKidsCountCache.clear(); this.pageKidsCountCache.clear();
var promises = []; var promises = [];
this.fontCache.forEach(function (promise) { this.fontCache.forEach(function (promise) {
@ -389,17 +393,21 @@ var Catalog = function CatalogClosure() {
var font = translatedFonts[i].dict; var font = translatedFonts[i].dict;
delete font.translated; delete font.translated;
} }
this.fontCache.clear(); _this.fontCache.clear();
this.builtInCMapCache = Object.create(null); _this.builtInCMapCache = Object.create(null);
}.bind(this)); });
}, },
getPage: function Catalog_getPage(pageIndex) { getPage: function Catalog_getPage(pageIndex) {
var _this2 = this;
if (!(pageIndex in this.pagePromises)) { if (!(pageIndex in this.pagePromises)) {
this.pagePromises[pageIndex] = this.getPageDict(pageIndex).then(function (a) { this.pagePromises[pageIndex] = this.getPageDict(pageIndex).then(function (_ref) {
var dict = a[0]; var _ref2 = _slicedToArray(_ref, 2),
var ref = a[1]; dict = _ref2[0],
return this.pageFactory.createPage(pageIndex, dict, ref, this.fontCache, this.builtInCMapCache); ref = _ref2[1];
}.bind(this));
return _this2.pageFactory.createPage(pageIndex, dict, ref, _this2.fontCache, _this2.builtInCMapCache);
});
} }
return this.pagePromises[pageIndex]; return this.pagePromises[pageIndex];
}, },
@ -1401,6 +1409,8 @@ var ObjectLoader = function () {
return this.capability.promise; return this.capability.promise;
}, },
_walk: function ObjectLoader_walk(nodesToVisit) { _walk: function ObjectLoader_walk(nodesToVisit) {
var _this3 = this;
var nodesToRevisit = []; var nodesToRevisit = [];
var pendingRequests = []; var pendingRequests = [];
while (nodesToVisit.length) { while (nodesToVisit.length) {
@ -1444,16 +1454,16 @@ var ObjectLoader = function () {
addChildren(currentNode, nodesToVisit); addChildren(currentNode, nodesToVisit);
} }
if (pendingRequests.length) { if (pendingRequests.length) {
this.xref.stream.manager.requestRanges(pendingRequests).then(function pendingRequestCallback() { this.xref.stream.manager.requestRanges(pendingRequests).then(function () {
nodesToVisit = nodesToRevisit; nodesToVisit = nodesToRevisit;
for (var i = 0; i < nodesToRevisit.length; i++) { for (var i = 0; i < nodesToRevisit.length; i++) {
var node = nodesToRevisit[i]; var node = nodesToRevisit[i];
if (isRef(node)) { if (isRef(node)) {
this.refSet.remove(node); _this3.refSet.remove(node);
} }
} }
this._walk(nodesToVisit); _this3._walk(nodesToVisit);
}.bind(this), this.capability.reject); }, this.capability.reject);
return; return;
} }
this.refSet = null; this.refSet = null;

19
lib/core/worker.js

@ -273,7 +273,7 @@ function setPDFNetworkStreamClass(cls) {
PDFNetworkStream = cls; PDFNetworkStream = cls;
} }
var WorkerMessageHandler = { var WorkerMessageHandler = {
setup: function wphSetup(handler, port) { setup: function setup(handler, port) {
var testMessageProcessed = false; var testMessageProcessed = false;
handler.on('test', function wphSetupTest(data) { handler.on('test', function wphSetupTest(data) {
if (testMessageProcessed) { if (testMessageProcessed) {
@ -309,7 +309,7 @@ var WorkerMessageHandler = {
return WorkerMessageHandler.createDocumentHandler(data, port); return WorkerMessageHandler.createDocumentHandler(data, port);
}); });
}, },
createDocumentHandler: function wphCreateDocumentHandler(docParams, port) { createDocumentHandler: function createDocumentHandler(docParams, port) {
var pdfManager; var pdfManager;
var terminated = false; var terminated = false;
var cancelXHRs = null; var cancelXHRs = null;
@ -672,15 +672,18 @@ var WorkerMessageHandler = {
docParams = null; docParams = null;
}); });
return workerHandlerName; return workerHandlerName;
},
initializeFromPort: function initializeFromPort(port) {
var handler = new MessageHandler('worker', 'main', port);
WorkerMessageHandler.setup(handler, port);
handler.send('ready', null);
} }
}; };
function initializeWorker() { function isMessagePort(maybePort) {
var handler = new MessageHandler('worker', 'main', self); return typeof maybePort.postMessage === 'function' && 'onmessage' in maybePort;
WorkerMessageHandler.setup(handler, self);
handler.send('ready', null);
} }
if (typeof window === 'undefined' && !isNodeJS()) { if (typeof window === 'undefined' && !isNodeJS() && typeof self !== 'undefined' && isMessagePort(self)) {
initializeWorker(); WorkerMessageHandler.initializeFromPort(self);
} }
exports.setPDFNetworkStreamClass = setPDFNetworkStreamClass; exports.setPDFNetworkStreamClass = setPDFNetworkStreamClass;
exports.WorkerTask = WorkerTask; exports.WorkerTask = WorkerTask;

105
lib/display/api.js

@ -17,7 +17,9 @@
Object.defineProperty(exports, "__esModule", { Object.defineProperty(exports, "__esModule", {
value: true value: true
}); });
exports.build = exports.version = exports._UnsupportedManager = exports.PDFPageProxy = exports.PDFDocumentProxy = exports.PDFWorker = exports.PDFDataRangeTransport = exports.getDocument = undefined; exports.build = exports.version = exports._UnsupportedManager = exports.PDFPageProxy = exports.PDFDocumentProxy = exports.PDFWorker = exports.PDFDataRangeTransport = exports.LoopbackPort = exports.getDocument = undefined;
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
@ -31,6 +33,8 @@ var _canvas = require('./canvas');
var _metadata = require('./metadata'); var _metadata = require('./metadata');
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var DEFAULT_RANGE_CHUNK_SIZE = 65536; var DEFAULT_RANGE_CHUNK_SIZE = 65536;
var isWorkerDisabled = false; var isWorkerDisabled = false;
var workerSrc; var workerSrc;
@ -546,42 +550,19 @@ var PDFPageProxy = function PDFPageProxyClosure() {
}; };
return PDFPageProxy; return PDFPageProxy;
}(); }();
var PDFWorker = function PDFWorkerClosure() {
var nextFakeWorkerId = 0; var LoopbackPort = function () {
function getWorkerSrc() { function LoopbackPort(defer) {
if (typeof workerSrc !== 'undefined') { _classCallCheck(this, LoopbackPort);
return workerSrc;
}
if ((0, _dom_utils.getDefaultSetting)('workerSrc')) {
return (0, _dom_utils.getDefaultSetting)('workerSrc');
}
if (pdfjsFilePath) {
return pdfjsFilePath.replace(/(\.(?:min\.)?js)(\?.*)?$/i, '.worker$1$2');
}
(0, _util.error)('No PDFJS.workerSrc specified');
}
var fakeWorkerFilesLoadedCapability;
function setupFakeWorkerGlobal() {
var WorkerMessageHandler;
if (fakeWorkerFilesLoadedCapability) {
return fakeWorkerFilesLoadedCapability.promise;
}
fakeWorkerFilesLoadedCapability = (0, _util.createPromiseCapability)();
var loader = fakeWorkerFilesLoader || function (callback) {
_util.Util.loadScript(getWorkerSrc(), function () {
callback(window.pdfjsDistBuildPdfWorker.WorkerMessageHandler);
});
};
loader(fakeWorkerFilesLoadedCapability.resolve);
return fakeWorkerFilesLoadedCapability.promise;
}
function FakeWorkerPort(defer) {
this._listeners = []; this._listeners = [];
this._defer = defer; this._defer = defer;
this._deferred = Promise.resolve(undefined); this._deferred = Promise.resolve(undefined);
} }
FakeWorkerPort.prototype = {
postMessage: function postMessage(obj, transfers) { _createClass(LoopbackPort, [{
key: 'postMessage',
value: function postMessage(obj, transfers) {
function cloneValue(value) { function cloneValue(value) {
if ((typeof value === 'undefined' ? 'undefined' : _typeof(value)) !== 'object' || value === null) { if ((typeof value === 'undefined' ? 'undefined' : _typeof(value)) !== 'object' || value === null) {
return value; return value;
@ -631,18 +612,57 @@ var PDFWorker = function PDFWorkerClosure() {
listener.call(this, e); listener.call(this, e);
}, this); }, this);
}.bind(this)); }.bind(this));
}, }
addEventListener: function addEventListener(name, listener) { }, {
key: 'addEventListener',
value: function addEventListener(name, listener) {
this._listeners.push(listener); this._listeners.push(listener);
}, }
removeEventListener: function removeEventListener(name, listener) { }, {
key: 'removeEventListener',
value: function removeEventListener(name, listener) {
var i = this._listeners.indexOf(listener); var i = this._listeners.indexOf(listener);
this._listeners.splice(i, 1); this._listeners.splice(i, 1);
}, }
terminate: function terminate() { }, {
key: 'terminate',
value: function terminate() {
this._listeners = []; this._listeners = [];
} }
}]);
return LoopbackPort;
}();
var PDFWorker = function PDFWorkerClosure() {
var nextFakeWorkerId = 0;
function getWorkerSrc() {
if (typeof workerSrc !== 'undefined') {
return workerSrc;
}
if ((0, _dom_utils.getDefaultSetting)('workerSrc')) {
return (0, _dom_utils.getDefaultSetting)('workerSrc');
}
if (pdfjsFilePath) {
return pdfjsFilePath.replace(/(\.(?:min\.)?js)(\?.*)?$/i, '.worker$1$2');
}
(0, _util.error)('No PDFJS.workerSrc specified');
}
var fakeWorkerFilesLoadedCapability;
function setupFakeWorkerGlobal() {
var WorkerMessageHandler;
if (fakeWorkerFilesLoadedCapability) {
return fakeWorkerFilesLoadedCapability.promise;
}
fakeWorkerFilesLoadedCapability = (0, _util.createPromiseCapability)();
var loader = fakeWorkerFilesLoader || function (callback) {
_util.Util.loadScript(getWorkerSrc(), function () {
callback(window.pdfjsDistBuildPdfWorker.WorkerMessageHandler);
});
}; };
loader(fakeWorkerFilesLoadedCapability.resolve);
return fakeWorkerFilesLoadedCapability.promise;
}
function createCDNWrapper(url) { function createCDNWrapper(url) {
var wrapper = 'importScripts(\'' + url + '\');'; var wrapper = 'importScripts(\'' + url + '\');';
return URL.createObjectURL(new Blob([wrapper])); return URL.createObjectURL(new Blob([wrapper]));
@ -771,7 +791,7 @@ var PDFWorker = function PDFWorkerClosure() {
return; return;
} }
var isTypedArraysPresent = Uint8Array !== Float32Array; var isTypedArraysPresent = Uint8Array !== Float32Array;
var port = new FakeWorkerPort(isTypedArraysPresent); var port = new LoopbackPort(isTypedArraysPresent);
this._port = port; this._port = port;
var id = 'fake' + nextFakeWorkerId++; var id = 'fake' + nextFakeWorkerId++;
var workerHandler = new _util.MessageHandler(id + '_worker', id, port); var workerHandler = new _util.MessageHandler(id + '_worker', id, port);
@ -1366,10 +1386,11 @@ var _UnsupportedManager = function UnsupportedManagerClosure() {
}(); }();
var version, build; var version, build;
{ {
exports.version = version = '1.8.292'; exports.version = version = '1.8.306';
exports.build = build = 'e18a08ff'; exports.build = build = '2ac41062';
} }
exports.getDocument = getDocument; exports.getDocument = getDocument;
exports.LoopbackPort = LoopbackPort;
exports.PDFDataRangeTransport = PDFDataRangeTransport; exports.PDFDataRangeTransport = PDFDataRangeTransport;
exports.PDFWorker = PDFWorker; exports.PDFWorker = PDFWorker;
exports.PDFDocumentProxy = PDFDocumentProxy; exports.PDFDocumentProxy = PDFDocumentProxy;

5
lib/display/global.js

@ -39,8 +39,8 @@ if (!_util.globalScope.PDFJS) {
} }
var PDFJS = _util.globalScope.PDFJS; var PDFJS = _util.globalScope.PDFJS;
{ {
PDFJS.version = '1.8.292'; PDFJS.version = '1.8.306';
PDFJS.build = 'e18a08ff'; PDFJS.build = '2ac41062';
} }
PDFJS.pdfBug = false; PDFJS.pdfBug = false;
if (PDFJS.verbosity !== undefined) { if (PDFJS.verbosity !== undefined) {
@ -128,6 +128,7 @@ PDFJS.pdfjsNext = PDFJS.pdfjsNext === undefined ? false : PDFJS.pdfjsNext;
} }
} }
PDFJS.getDocument = _api.getDocument; PDFJS.getDocument = _api.getDocument;
PDFJS.LoopbackPort = _api.LoopbackPort;
PDFJS.PDFDataRangeTransport = _api.PDFDataRangeTransport; PDFJS.PDFDataRangeTransport = _api.PDFDataRangeTransport;
PDFJS.PDFWorker = _api.PDFWorker; PDFJS.PDFWorker = _api.PDFWorker;
PDFJS.hasCanvasTypedArrays = true; PDFJS.hasCanvasTypedArrays = true;

5
lib/pdf.js

@ -14,8 +14,8 @@
*/ */
'use strict'; 'use strict';
var pdfjsVersion = '1.8.292'; var pdfjsVersion = '1.8.306';
var pdfjsBuild = 'e18a08ff'; var pdfjsBuild = '2ac41062';
var pdfjsSharedUtil = require('./shared/util.js'); var pdfjsSharedUtil = require('./shared/util.js');
var pdfjsDisplayGlobal = require('./display/global.js'); var pdfjsDisplayGlobal = require('./display/global.js');
var pdfjsDisplayAPI = require('./display/api.js'); var pdfjsDisplayAPI = require('./display/api.js');
@ -27,6 +27,7 @@ exports.PDFJS = pdfjsDisplayGlobal.PDFJS;
exports.build = pdfjsDisplayAPI.build; exports.build = pdfjsDisplayAPI.build;
exports.version = pdfjsDisplayAPI.version; exports.version = pdfjsDisplayAPI.version;
exports.getDocument = pdfjsDisplayAPI.getDocument; exports.getDocument = pdfjsDisplayAPI.getDocument;
exports.LoobpackPort = pdfjsDisplayAPI.LoopbackPort;
exports.PDFDataRangeTransport = pdfjsDisplayAPI.PDFDataRangeTransport; exports.PDFDataRangeTransport = pdfjsDisplayAPI.PDFDataRangeTransport;
exports.PDFWorker = pdfjsDisplayAPI.PDFWorker; exports.PDFWorker = pdfjsDisplayAPI.PDFWorker;
exports.renderTextLayer = pdfjsDisplayTextLayer.renderTextLayer; exports.renderTextLayer = pdfjsDisplayTextLayer.renderTextLayer;

4
lib/pdf.worker.js vendored

@ -14,8 +14,8 @@
*/ */
'use strict'; 'use strict';
var pdfjsVersion = '1.8.292'; var pdfjsVersion = '1.8.306';
var pdfjsBuild = 'e18a08ff'; var pdfjsBuild = '2ac41062';
var pdfjsCoreWorker = require('./core/worker.js'); var pdfjsCoreWorker = require('./core/worker.js');
{ {
require('./core/network.js'); require('./core/network.js');

2
package.json

@ -1,6 +1,6 @@
{ {
"name": "pdfjs-dist", "name": "pdfjs-dist",
"version": "1.8.292", "version": "1.8.306",
"main": "build/pdf.js", "main": "build/pdf.js",
"description": "Generic build of Mozilla's PDF.js library.", "description": "Generic build of Mozilla's PDF.js library.",
"keywords": [ "keywords": [

Loading…
Cancel
Save