diff --git a/bower.json b/bower.json index 65d079374..e5b0fda13 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "pdfjs-dist", - "version": "1.3.46", + "version": "1.3.48", "main": [ "build/pdf.js", "build/pdf.worker.js" diff --git a/build/pdf.combined.js b/build/pdf.combined.js index a022f6db7..aebe9981b 100644 --- a/build/pdf.combined.js +++ b/build/pdf.combined.js @@ -20,8 +20,8 @@ if (typeof PDFJS === 'undefined') { (typeof window !== 'undefined' ? window : this).PDFJS = {}; } -PDFJS.version = '1.3.46'; -PDFJS.build = '4a82f2f'; +PDFJS.version = '1.3.48'; +PDFJS.build = '5f56a20'; (function pdfjsWrapper() { // Use strict in our context only - users might not want it @@ -9520,7 +9520,6 @@ var ChunkedStreamManager = (function ChunkedStreamManagerClosure() { })(); -// TODO(mack): Make use of PDFJS.Util.inherit() when it becomes available var BasePdfManager = (function BasePdfManagerClosure() { function BasePdfManager() { throw new Error('Cannot initialize BaseManagerManager'); @@ -9547,7 +9546,7 @@ var BasePdfManager = (function BasePdfManagerClosure() { return this.ensure(this.pdfDocument.catalog, prop, args); }, - getPage: function BasePdfManager_pagePage(pageIndex) { + getPage: function BasePdfManager_getPage(pageIndex) { return this.pdfDocument.getPage(pageIndex); }, @@ -9559,7 +9558,7 @@ var BasePdfManager = (function BasePdfManagerClosure() { return new NotImplementedException(); }, - requestRange: function BasePdfManager_ensure(begin, end) { + requestRange: function BasePdfManager_requestRange(begin, end) { return new NotImplementedException(); }, @@ -9600,45 +9599,40 @@ var LocalPdfManager = (function LocalPdfManagerClosure() { this._loadedStreamCapability.resolve(stream); } - LocalPdfManager.prototype = Object.create(BasePdfManager.prototype); - LocalPdfManager.prototype.constructor = LocalPdfManager; - - LocalPdfManager.prototype.ensure = - function LocalPdfManager_ensure(obj, prop, args) { - return new Promise(function (resolve, reject) { - try { - var value = obj[prop]; - var result; - if (typeof value === 'function') { - result = value.apply(obj, args); - } else { - result = value; + Util.inherit(LocalPdfManager, BasePdfManager, { + ensure: function LocalPdfManager_ensure(obj, prop, args) { + return new Promise(function (resolve, reject) { + try { + var value = obj[prop]; + var result; + if (typeof value === 'function') { + result = value.apply(obj, args); + } else { + result = value; + } + resolve(result); + } catch (e) { + reject(e); } - resolve(result); - } catch (e) { - reject(e); - } - }); - }; + }); + }, - LocalPdfManager.prototype.requestRange = - function LocalPdfManager_requestRange(begin, end) { - return Promise.resolve(); - }; + requestRange: function LocalPdfManager_requestRange(begin, end) { + return Promise.resolve(); + }, - LocalPdfManager.prototype.requestLoadedStream = - function LocalPdfManager_requestLoadedStream() { - }; + requestLoadedStream: function LocalPdfManager_requestLoadedStream() { + return; + }, - LocalPdfManager.prototype.onLoadedStream = - function LocalPdfManager_getLoadedStream() { - return this._loadedStreamCapability.promise; - }; + onLoadedStream: function LocalPdfManager_onLoadedStream() { + return this._loadedStreamCapability.promise; + }, - LocalPdfManager.prototype.terminate = - function LocalPdfManager_terminate() { - return; - }; + terminate: function LocalPdfManager_terminate() { + return; + } + }); return LocalPdfManager; })(); @@ -9659,67 +9653,60 @@ var NetworkPdfManager = (function NetworkPdfManagerClosure() { this.streamManager = new ChunkedStreamManager(args.length, args.rangeChunkSize, args.url, params); - this.pdfDocument = new PDFDocument(this, this.streamManager.getStream(), - args.password); + args.password); } - NetworkPdfManager.prototype = Object.create(BasePdfManager.prototype); - NetworkPdfManager.prototype.constructor = NetworkPdfManager; - - NetworkPdfManager.prototype.ensure = - function NetworkPdfManager_ensure(obj, prop, args) { - var pdfManager = this; + Util.inherit(NetworkPdfManager, BasePdfManager, { + ensure: function NetworkPdfManager_ensure(obj, prop, args) { + var pdfManager = this; - return new Promise(function (resolve, reject) { - function ensureHelper() { - try { - var result; - var value = obj[prop]; - if (typeof value === 'function') { - result = value.apply(obj, args); - } else { - result = value; - } - resolve(result); - } catch(e) { - if (!(e instanceof MissingDataException)) { - reject(e); - return; + return new Promise(function (resolve, reject) { + function ensureHelper() { + try { + var result; + var value = obj[prop]; + if (typeof value === 'function') { + result = value.apply(obj, args); + } else { + result = value; + } + resolve(result); + } catch(e) { + if (!(e instanceof MissingDataException)) { + reject(e); + return; + } + pdfManager.streamManager.requestRange(e.begin, e.end). + then(ensureHelper, reject); } - pdfManager.streamManager.requestRange(e.begin, e.end). - then(ensureHelper, reject); } - } - ensureHelper(); - }); - }; + ensureHelper(); + }); + }, - NetworkPdfManager.prototype.requestRange = - function NetworkPdfManager_requestRange(begin, end) { - return this.streamManager.requestRange(begin, end); - }; + requestRange: function NetworkPdfManager_requestRange(begin, end) { + return this.streamManager.requestRange(begin, end); + }, - NetworkPdfManager.prototype.requestLoadedStream = - function NetworkPdfManager_requestLoadedStream() { - this.streamManager.requestAllChunks(); - }; + requestLoadedStream: function NetworkPdfManager_requestLoadedStream() { + this.streamManager.requestAllChunks(); + }, - NetworkPdfManager.prototype.sendProgressiveData = - function NetworkPdfManager_sendProgressiveData(chunk) { - this.streamManager.onReceiveData({ chunk: chunk }); - }; + sendProgressiveData: + function NetworkPdfManager_sendProgressiveData(chunk) { + this.streamManager.onReceiveData({ chunk: chunk }); + }, - NetworkPdfManager.prototype.onLoadedStream = - function NetworkPdfManager_getLoadedStream() { - return this.streamManager.onLoadedStream(); - }; + onLoadedStream: function NetworkPdfManager_onLoadedStream() { + return this.streamManager.onLoadedStream(); + }, - NetworkPdfManager.prototype.terminate = - function NetworkPdfManager_terminate() { - this.streamManager.abort(); - }; + terminate: function NetworkPdfManager_terminate() { + this.streamManager.abort(); + } + }); return NetworkPdfManager; })(); diff --git a/build/pdf.js b/build/pdf.js index e1fec01df..c8b2c2cdf 100644 --- a/build/pdf.js +++ b/build/pdf.js @@ -20,8 +20,8 @@ if (typeof PDFJS === 'undefined') { (typeof window !== 'undefined' ? window : this).PDFJS = {}; } -PDFJS.version = '1.3.46'; -PDFJS.build = '4a82f2f'; +PDFJS.version = '1.3.48'; +PDFJS.build = '5f56a20'; (function pdfjsWrapper() { // Use strict in our context only - users might not want it diff --git a/build/pdf.worker.js b/build/pdf.worker.js index 18c4dd315..5c43443fb 100644 --- a/build/pdf.worker.js +++ b/build/pdf.worker.js @@ -20,8 +20,8 @@ if (typeof PDFJS === 'undefined') { (typeof window !== 'undefined' ? window : this).PDFJS = {}; } -PDFJS.version = '1.3.46'; -PDFJS.build = '4a82f2f'; +PDFJS.version = '1.3.48'; +PDFJS.build = '5f56a20'; (function pdfjsWrapper() { // Use strict in our context only - users might not want it @@ -2447,7 +2447,6 @@ var ChunkedStreamManager = (function ChunkedStreamManagerClosure() { })(); -// TODO(mack): Make use of PDFJS.Util.inherit() when it becomes available var BasePdfManager = (function BasePdfManagerClosure() { function BasePdfManager() { throw new Error('Cannot initialize BaseManagerManager'); @@ -2474,7 +2473,7 @@ var BasePdfManager = (function BasePdfManagerClosure() { return this.ensure(this.pdfDocument.catalog, prop, args); }, - getPage: function BasePdfManager_pagePage(pageIndex) { + getPage: function BasePdfManager_getPage(pageIndex) { return this.pdfDocument.getPage(pageIndex); }, @@ -2486,7 +2485,7 @@ var BasePdfManager = (function BasePdfManagerClosure() { return new NotImplementedException(); }, - requestRange: function BasePdfManager_ensure(begin, end) { + requestRange: function BasePdfManager_requestRange(begin, end) { return new NotImplementedException(); }, @@ -2527,45 +2526,40 @@ var LocalPdfManager = (function LocalPdfManagerClosure() { this._loadedStreamCapability.resolve(stream); } - LocalPdfManager.prototype = Object.create(BasePdfManager.prototype); - LocalPdfManager.prototype.constructor = LocalPdfManager; - - LocalPdfManager.prototype.ensure = - function LocalPdfManager_ensure(obj, prop, args) { - return new Promise(function (resolve, reject) { - try { - var value = obj[prop]; - var result; - if (typeof value === 'function') { - result = value.apply(obj, args); - } else { - result = value; + Util.inherit(LocalPdfManager, BasePdfManager, { + ensure: function LocalPdfManager_ensure(obj, prop, args) { + return new Promise(function (resolve, reject) { + try { + var value = obj[prop]; + var result; + if (typeof value === 'function') { + result = value.apply(obj, args); + } else { + result = value; + } + resolve(result); + } catch (e) { + reject(e); } - resolve(result); - } catch (e) { - reject(e); - } - }); - }; + }); + }, - LocalPdfManager.prototype.requestRange = - function LocalPdfManager_requestRange(begin, end) { - return Promise.resolve(); - }; + requestRange: function LocalPdfManager_requestRange(begin, end) { + return Promise.resolve(); + }, - LocalPdfManager.prototype.requestLoadedStream = - function LocalPdfManager_requestLoadedStream() { - }; + requestLoadedStream: function LocalPdfManager_requestLoadedStream() { + return; + }, - LocalPdfManager.prototype.onLoadedStream = - function LocalPdfManager_getLoadedStream() { - return this._loadedStreamCapability.promise; - }; + onLoadedStream: function LocalPdfManager_onLoadedStream() { + return this._loadedStreamCapability.promise; + }, - LocalPdfManager.prototype.terminate = - function LocalPdfManager_terminate() { - return; - }; + terminate: function LocalPdfManager_terminate() { + return; + } + }); return LocalPdfManager; })(); @@ -2586,67 +2580,60 @@ var NetworkPdfManager = (function NetworkPdfManagerClosure() { this.streamManager = new ChunkedStreamManager(args.length, args.rangeChunkSize, args.url, params); - this.pdfDocument = new PDFDocument(this, this.streamManager.getStream(), - args.password); + args.password); } - NetworkPdfManager.prototype = Object.create(BasePdfManager.prototype); - NetworkPdfManager.prototype.constructor = NetworkPdfManager; - - NetworkPdfManager.prototype.ensure = - function NetworkPdfManager_ensure(obj, prop, args) { - var pdfManager = this; + Util.inherit(NetworkPdfManager, BasePdfManager, { + ensure: function NetworkPdfManager_ensure(obj, prop, args) { + var pdfManager = this; - return new Promise(function (resolve, reject) { - function ensureHelper() { - try { - var result; - var value = obj[prop]; - if (typeof value === 'function') { - result = value.apply(obj, args); - } else { - result = value; - } - resolve(result); - } catch(e) { - if (!(e instanceof MissingDataException)) { - reject(e); - return; + return new Promise(function (resolve, reject) { + function ensureHelper() { + try { + var result; + var value = obj[prop]; + if (typeof value === 'function') { + result = value.apply(obj, args); + } else { + result = value; + } + resolve(result); + } catch(e) { + if (!(e instanceof MissingDataException)) { + reject(e); + return; + } + pdfManager.streamManager.requestRange(e.begin, e.end). + then(ensureHelper, reject); } - pdfManager.streamManager.requestRange(e.begin, e.end). - then(ensureHelper, reject); } - } - ensureHelper(); - }); - }; + ensureHelper(); + }); + }, - NetworkPdfManager.prototype.requestRange = - function NetworkPdfManager_requestRange(begin, end) { - return this.streamManager.requestRange(begin, end); - }; + requestRange: function NetworkPdfManager_requestRange(begin, end) { + return this.streamManager.requestRange(begin, end); + }, - NetworkPdfManager.prototype.requestLoadedStream = - function NetworkPdfManager_requestLoadedStream() { - this.streamManager.requestAllChunks(); - }; + requestLoadedStream: function NetworkPdfManager_requestLoadedStream() { + this.streamManager.requestAllChunks(); + }, - NetworkPdfManager.prototype.sendProgressiveData = - function NetworkPdfManager_sendProgressiveData(chunk) { - this.streamManager.onReceiveData({ chunk: chunk }); - }; + sendProgressiveData: + function NetworkPdfManager_sendProgressiveData(chunk) { + this.streamManager.onReceiveData({ chunk: chunk }); + }, - NetworkPdfManager.prototype.onLoadedStream = - function NetworkPdfManager_getLoadedStream() { - return this.streamManager.onLoadedStream(); - }; + onLoadedStream: function NetworkPdfManager_onLoadedStream() { + return this.streamManager.onLoadedStream(); + }, - NetworkPdfManager.prototype.terminate = - function NetworkPdfManager_terminate() { - this.streamManager.abort(); - }; + terminate: function NetworkPdfManager_terminate() { + this.streamManager.abort(); + } + }); return NetworkPdfManager; })(); diff --git a/package.json b/package.json index d2f919491..c9e335b8d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pdfjs-dist", - "version": "1.3.46", + "version": "1.3.48", "description": "Generic build of Mozilla's PDF.js library.", "keywords": [ "Mozilla",