From a7cd5f77b00bac19c0f6ee4c2cfd5bbf0fe45d8f Mon Sep 17 00:00:00 2001 From: Pdf Bot Date: Mon, 21 Dec 2015 21:47:03 +0000 Subject: [PATCH] PDF.js version 1.3.122 - See mozilla/pdf.js@05b9d3730a001d9ba440509e2cec5d8c7e2fada0 --- bower.json | 2 +- build/pdf.combined.js | 21 ++++++++++++-------- build/pdf.js | 45 +++++++++++++++++++++++++++++++++++-------- build/pdf.worker.js | 14 ++++++++------ package.json | 3 ++- 5 files changed, 61 insertions(+), 24 deletions(-) diff --git a/bower.json b/bower.json index bb11a4161..9bcf29454 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "pdfjs-dist", - "version": "1.3.120", + "version": "1.3.122", "main": [ "build/pdf.js", "build/pdf.worker.js" diff --git a/build/pdf.combined.js b/build/pdf.combined.js index 7fcb1756e..ac9c940d9 100644 --- a/build/pdf.combined.js +++ b/build/pdf.combined.js @@ -12,16 +12,17 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/*jshint globalstrict: false */ -/* globals PDFJS */ +/* jshint globalstrict: false */ +/* globals PDFJS, global */ // Initializing PDFJS global object (if still undefined) if (typeof PDFJS === 'undefined') { - (typeof window !== 'undefined' ? window : this).PDFJS = {}; + (typeof window !== 'undefined' ? window : + typeof global !== 'undefined' ? global : this).PDFJS = {}; } -PDFJS.version = '1.3.120'; -PDFJS.build = 'eb557d2'; +PDFJS.version = '1.3.122'; +PDFJS.build = '05b9d37'; (function pdfjsWrapper() { // Use strict in our context only - users might not want it @@ -6155,6 +6156,7 @@ var globalScope = sharedGlobal.globalScope; var DEFAULT_RANGE_CHUNK_SIZE = 65536; // 2^16 = 65536 + /** * The maximum allowed image size in total pixels e.g. width * height. Images * above this value will not be drawn. Use -1 for no limit. @@ -7314,8 +7316,10 @@ var PDFWorker = (function PDFWorkerClosure() { }, _setupFakeWorker: function PDFWorker_setupFakeWorker() { - warn('Setting up fake worker.'); - globalScope.PDFJS.disableWorker = true; + if (!globalScope.PDFJS.disableWorker) { + warn('Setting up fake worker.'); + globalScope.PDFJS.disableWorker = true; + } setupFakeWorkerGlobal().then(function () { if (this.destroyed) { @@ -48509,7 +48513,8 @@ var workerConsole = { // Worker thread? -if (typeof window === 'undefined' && typeof require === 'undefined') { +if (typeof window === 'undefined' && + !(typeof module !== 'undefined' && module.require)) { if (!('console' in globalScope)) { globalScope.console = workerConsole; } diff --git a/build/pdf.js b/build/pdf.js index dead16908..99556e67a 100644 --- a/build/pdf.js +++ b/build/pdf.js @@ -12,16 +12,17 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/*jshint globalstrict: false */ -/* globals PDFJS */ +/* jshint globalstrict: false */ +/* globals PDFJS, global */ // Initializing PDFJS global object (if still undefined) if (typeof PDFJS === 'undefined') { - (typeof window !== 'undefined' ? window : this).PDFJS = {}; + (typeof window !== 'undefined' ? window : + typeof global !== 'undefined' ? global : this).PDFJS = {}; } -PDFJS.version = '1.3.120'; -PDFJS.build = 'eb557d2'; +PDFJS.version = '1.3.122'; +PDFJS.build = '05b9d37'; (function pdfjsWrapper() { // Use strict in our context only - users might not want it @@ -6156,6 +6157,29 @@ var globalScope = sharedGlobal.globalScope; var DEFAULT_RANGE_CHUNK_SIZE = 65536; // 2^16 = 65536 + +var useRequireEnsure = false; +if (typeof module !== 'undefined' && module.require) { + // node.js - disable worker and set require.ensure. + PDFJS.disableWorker = true; + if (typeof require.ensure === 'undefined') { + require.ensure = require('node-ensure'); + } + useRequireEnsure = true; +} +if (typeof __webpack_require__ !== 'undefined') { + // Webpack - get/bundle pdf.worker.js as additional file. + PDFJS.workerSrc = require('entry?name=[hash]-worker.js!./pdf.worker.js'); + useRequireEnsure = true; +} +var fakeWorkerFilesLoader = useRequireEnsure && function (callback) { + require.ensure([], function () { + require('./pdf.worker.js'); + callback(); + }); +}; + + /** * The maximum allowed image size in total pixels e.g. width * height. Images * above this value will not be drawn. Use -1 for no limit. @@ -7274,7 +7298,10 @@ var PDFWorker = (function PDFWorkerClosure() { // In the developer build load worker_loader which in turn loads all the // other files and resolves the promise. In production only the // pdf.worker.js file is needed. - Util.loadScript(PDFJS.workerSrc, function() { + var loader = fakeWorkerFilesLoader || function (callback) { + Util.loadScript(PDFJS.workerSrc, callback); + }; + loader(function () { PDFJS.fakeWorkerFilesLoadedCapability.resolve(); }); } @@ -7374,8 +7401,10 @@ var PDFWorker = (function PDFWorkerClosure() { }, _setupFakeWorker: function PDFWorker_setupFakeWorker() { - warn('Setting up fake worker.'); - globalScope.PDFJS.disableWorker = true; + if (!globalScope.PDFJS.disableWorker) { + warn('Setting up fake worker.'); + globalScope.PDFJS.disableWorker = true; + } setupFakeWorkerGlobal().then(function () { if (this.destroyed) { diff --git a/build/pdf.worker.js b/build/pdf.worker.js index d79a9b9a9..0d5d390a5 100644 --- a/build/pdf.worker.js +++ b/build/pdf.worker.js @@ -12,16 +12,17 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/*jshint globalstrict: false */ -/* globals PDFJS */ +/* jshint globalstrict: false */ +/* globals PDFJS, global */ // Initializing PDFJS global object (if still undefined) if (typeof PDFJS === 'undefined') { - (typeof window !== 'undefined' ? window : this).PDFJS = {}; + (typeof window !== 'undefined' ? window : + typeof global !== 'undefined' ? global : this).PDFJS = {}; } -PDFJS.version = '1.3.120'; -PDFJS.build = 'eb557d2'; +PDFJS.version = '1.3.122'; +PDFJS.build = '05b9d37'; (function pdfjsWrapper() { // Use strict in our context only - users might not want it @@ -40929,7 +40930,8 @@ var workerConsole = { // Worker thread? -if (typeof window === 'undefined' && typeof require === 'undefined') { +if (typeof window === 'undefined' && + !(typeof module !== 'undefined' && module.require)) { if (!('console' in globalScope)) { globalScope.console = workerConsole; } diff --git a/package.json b/package.json index d61cbf4f1..c0cfa4fa5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,7 @@ { "name": "pdfjs-dist", - "version": "1.3.120", + "version": "1.3.122", + "main": "build/pdf.js", "description": "Generic build of Mozilla's PDF.js library.", "keywords": [ "Mozilla",