Browse Source

PDF.js version 2.0.260 - See mozilla/pdf.js@d77fc8882ae38805b39b09d0abf05dc8c4bc2671

pdfjsbot 7 years ago
parent
commit
6bb128d950

+ 1 - 1
bower.json

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

+ 36 - 19
build/pdf.combined.js

@@ -3657,16 +3657,10 @@ var ColorSpace = function ColorSpaceClosure() {
         throw new _util.FormatError('Unknown colorspace name: ' + name);
     }
   };
-  ColorSpace.parseToIR = function (cs, xref, res, pdfFunctionFactory) {
-    if ((0, _primitives.isName)(cs)) {
-      var colorSpaces = res.get('ColorSpace');
-      if ((0, _primitives.isDict)(colorSpaces)) {
-        var refcs = colorSpaces.get(cs.name);
-        if (refcs) {
-          cs = refcs;
-        }
-      }
-    }
+  ColorSpace.parseToIR = function (cs, xref) {
+    var res = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
+    var pdfFunctionFactory = arguments[3];
+
     cs = xref.fetchIfRef(cs);
     if ((0, _primitives.isName)(cs)) {
       switch (cs.name) {
@@ -3682,6 +3676,19 @@ var ColorSpace = function ColorSpaceClosure() {
         case 'Pattern':
           return ['PatternCS', null];
         default:
+          if ((0, _primitives.isDict)(res)) {
+            var colorSpaces = res.get('ColorSpace');
+            if ((0, _primitives.isDict)(colorSpaces)) {
+              var resCS = colorSpaces.get(cs.name);
+              if (resCS) {
+                if ((0, _primitives.isName)(resCS)) {
+                  return ColorSpace.parseToIR(resCS, xref, res, pdfFunctionFactory);
+                }
+                cs = resCS;
+                break;
+              }
+            }
+          }
           throw new _util.FormatError('unrecognized colorspace ' + cs.name);
       }
     }
@@ -11612,7 +11619,7 @@ function _fetchDocument(worker, source, pdfDataRangeTransport, docId) {
   if (worker.destroyed) {
     return Promise.reject(new Error('Worker was destroyed'));
   }
-  var apiVersion = '2.0.258';
+  var apiVersion = '2.0.260';
   source.disableRange = (0, _dom_utils.getDefaultSetting)('disableRange');
   source.disableAutoFetch = (0, _dom_utils.getDefaultSetting)('disableAutoFetch');
   source.disableStream = (0, _dom_utils.getDefaultSetting)('disableStream');
@@ -12904,8 +12911,8 @@ var InternalRenderTask = function InternalRenderTaskClosure() {
 }();
 var version, build;
 {
-  exports.version = version = '2.0.258';
-  exports.build = build = '5a52ee0a';
+  exports.version = version = '2.0.260';
+  exports.build = build = 'd77fc888';
 }
 exports.getDocument = getDocument;
 exports.LoopbackPort = LoopbackPort;
@@ -26696,8 +26703,8 @@ exports.SVGGraphics = SVGGraphics;
 "use strict";
 
 
-var pdfjsVersion = '2.0.258';
-var pdfjsBuild = '5a52ee0a';
+var pdfjsVersion = '2.0.260';
+var pdfjsBuild = 'd77fc888';
 var pdfjsSharedUtil = __w_pdfjs_require__(0);
 var pdfjsDisplayGlobal = __w_pdfjs_require__(131);
 var pdfjsDisplayAPI = __w_pdfjs_require__(65);
@@ -31876,8 +31883,8 @@ if (!_global_scope2.default.PDFJS) {
 }
 var PDFJS = _global_scope2.default.PDFJS;
 {
-  PDFJS.version = '2.0.258';
-  PDFJS.build = '5a52ee0a';
+  PDFJS.version = '2.0.260';
+  PDFJS.build = 'd77fc888';
 }
 PDFJS.pdfBug = false;
 if (PDFJS.verbosity !== undefined) {
@@ -35238,7 +35245,7 @@ var WorkerMessageHandler = {
     var cancelXHRs = null;
     var WorkerTasks = [];
     var apiVersion = docParams.apiVersion;
-    var workerVersion = '2.0.258';
+    var workerVersion = '2.0.260';
     if (apiVersion !== null && apiVersion !== workerVersion) {
       throw new Error('The API version "' + apiVersion + '" does not match ' + ('the Worker version "' + workerVersion + '".'));
     }
@@ -40583,6 +40590,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
           xref: this.xref,
           res: resources,
           image: image,
+          isInline: inline,
           pdfFunctionFactory: this.pdfFunctionFactory
         });
         imgData = imageObj.createImageData(true);
@@ -40619,6 +40627,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
         xref: this.xref,
         res: resources,
         image: image,
+        isInline: inline,
         nativeDecoder: nativeImageDecoder,
         pdfFunctionFactory: this.pdfFunctionFactory
       }).then(function (imageObj) {
@@ -51935,6 +51944,8 @@ var PDFImage = function PDFImageClosure() {
     var xref = _ref.xref,
         res = _ref.res,
         image = _ref.image,
+        _ref$isInline = _ref.isInline,
+        isInline = _ref$isInline === undefined ? false : _ref$isInline,
         _ref$smask = _ref.smask,
         smask = _ref$smask === undefined ? null : _ref$smask,
         _ref$mask = _ref.mask,
@@ -51996,7 +52007,8 @@ var PDFImage = function PDFImageClosure() {
             throw new Error('JPX images with ' + this.numComps + ' ' + 'color components not supported.');
         }
       }
-      this.colorSpace = _colorspace.ColorSpace.parse(colorSpace, xref, res, pdfFunctionFactory);
+      var resources = isInline ? res : null;
+      this.colorSpace = _colorspace.ColorSpace.parse(colorSpace, xref, resources, pdfFunctionFactory);
       this.numComps = this.colorSpace.numComps;
     }
     this.decode = dict.getArray('Decode', 'D');
@@ -52018,6 +52030,7 @@ var PDFImage = function PDFImageClosure() {
         xref: xref,
         res: res,
         image: smask,
+        isInline: isInline,
         pdfFunctionFactory: pdfFunctionFactory
       });
     } else if (mask) {
@@ -52031,6 +52044,7 @@ var PDFImage = function PDFImageClosure() {
             xref: xref,
             res: res,
             image: mask,
+            isInline: isInline,
             isMask: true,
             pdfFunctionFactory: pdfFunctionFactory
           });
@@ -52045,6 +52059,8 @@ var PDFImage = function PDFImageClosure() {
         xref = _ref2.xref,
         res = _ref2.res,
         image = _ref2.image,
+        _ref2$isInline = _ref2.isInline,
+        isInline = _ref2$isInline === undefined ? false : _ref2$isInline,
         _ref2$nativeDecoder = _ref2.nativeDecoder,
         nativeDecoder = _ref2$nativeDecoder === undefined ? null : _ref2$nativeDecoder,
         pdfFunctionFactory = _ref2.pdfFunctionFactory;
@@ -52082,6 +52098,7 @@ var PDFImage = function PDFImageClosure() {
         xref: xref,
         res: res,
         image: imageData,
+        isInline: isInline,
         smask: smaskData,
         mask: maskData,
         pdfFunctionFactory: pdfFunctionFactory

File diff suppressed because it is too large
+ 0 - 0
build/pdf.combined.js.map


+ 7 - 7
build/pdf.js

@@ -3299,7 +3299,7 @@ function _fetchDocument(worker, source, pdfDataRangeTransport, docId) {
   if (worker.destroyed) {
     return Promise.reject(new Error('Worker was destroyed'));
   }
-  var apiVersion = '2.0.258';
+  var apiVersion = '2.0.260';
   source.disableRange = (0, _dom_utils.getDefaultSetting)('disableRange');
   source.disableAutoFetch = (0, _dom_utils.getDefaultSetting)('disableAutoFetch');
   source.disableStream = (0, _dom_utils.getDefaultSetting)('disableStream');
@@ -4672,8 +4672,8 @@ var InternalRenderTask = function InternalRenderTaskClosure() {
 }();
 var version, build;
 {
-  exports.version = version = '2.0.258';
-  exports.build = build = '5a52ee0a';
+  exports.version = version = '2.0.260';
+  exports.build = build = 'd77fc888';
 }
 exports.getDocument = getDocument;
 exports.LoopbackPort = LoopbackPort;
@@ -7425,8 +7425,8 @@ exports.SVGGraphics = SVGGraphics;
 "use strict";
 
 
-var pdfjsVersion = '2.0.258';
-var pdfjsBuild = '5a52ee0a';
+var pdfjsVersion = '2.0.260';
+var pdfjsBuild = 'd77fc888';
 var pdfjsSharedUtil = __w_pdfjs_require__(0);
 var pdfjsDisplayGlobal = __w_pdfjs_require__(114);
 var pdfjsDisplayAPI = __w_pdfjs_require__(57);
@@ -12605,8 +12605,8 @@ if (!_global_scope2.default.PDFJS) {
 }
 var PDFJS = _global_scope2.default.PDFJS;
 {
-  PDFJS.version = '2.0.258';
-  PDFJS.build = '5a52ee0a';
+  PDFJS.version = '2.0.260';
+  PDFJS.build = 'd77fc888';
 }
 PDFJS.pdfBug = false;
 if (PDFJS.verbosity !== undefined) {

File diff suppressed because it is too large
+ 0 - 0
build/pdf.js.map


File diff suppressed because it is too large
+ 0 - 0
build/pdf.min.js


+ 31 - 14
build/pdf.worker.js

@@ -3135,16 +3135,10 @@ var ColorSpace = function ColorSpaceClosure() {
         throw new _util.FormatError('Unknown colorspace name: ' + name);
     }
   };
-  ColorSpace.parseToIR = function (cs, xref, res, pdfFunctionFactory) {
-    if ((0, _primitives.isName)(cs)) {
-      var colorSpaces = res.get('ColorSpace');
-      if ((0, _primitives.isDict)(colorSpaces)) {
-        var refcs = colorSpaces.get(cs.name);
-        if (refcs) {
-          cs = refcs;
-        }
-      }
-    }
+  ColorSpace.parseToIR = function (cs, xref) {
+    var res = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
+    var pdfFunctionFactory = arguments[3];
+
     cs = xref.fetchIfRef(cs);
     if ((0, _primitives.isName)(cs)) {
       switch (cs.name) {
@@ -3160,6 +3154,19 @@ var ColorSpace = function ColorSpaceClosure() {
         case 'Pattern':
           return ['PatternCS', null];
         default:
+          if ((0, _primitives.isDict)(res)) {
+            var colorSpaces = res.get('ColorSpace');
+            if ((0, _primitives.isDict)(colorSpaces)) {
+              var resCS = colorSpaces.get(cs.name);
+              if (resCS) {
+                if ((0, _primitives.isName)(resCS)) {
+                  return ColorSpace.parseToIR(resCS, xref, res, pdfFunctionFactory);
+                }
+                cs = resCS;
+                break;
+              }
+            }
+          }
           throw new _util.FormatError('unrecognized colorspace ' + cs.name);
       }
     }
@@ -21939,8 +21946,8 @@ exports.PostScriptCompiler = PostScriptCompiler;
 "use strict";
 
 
-var pdfjsVersion = '2.0.258';
-var pdfjsBuild = '5a52ee0a';
+var pdfjsVersion = '2.0.260';
+var pdfjsBuild = 'd77fc888';
 var pdfjsCoreWorker = __w_pdfjs_require__(72);
 exports.WorkerMessageHandler = pdfjsCoreWorker.WorkerMessageHandler;
 
@@ -22147,7 +22154,7 @@ var WorkerMessageHandler = {
     var cancelXHRs = null;
     var WorkerTasks = [];
     var apiVersion = docParams.apiVersion;
-    var workerVersion = '2.0.258';
+    var workerVersion = '2.0.260';
     if (apiVersion !== null && apiVersion !== workerVersion) {
       throw new Error('The API version "' + apiVersion + '" does not match ' + ('the Worker version "' + workerVersion + '".'));
     }
@@ -32596,6 +32603,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
           xref: this.xref,
           res: resources,
           image: image,
+          isInline: inline,
           pdfFunctionFactory: this.pdfFunctionFactory
         });
         imgData = imageObj.createImageData(true);
@@ -32632,6 +32640,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
         xref: this.xref,
         res: resources,
         image: image,
+        isInline: inline,
         nativeDecoder: nativeImageDecoder,
         pdfFunctionFactory: this.pdfFunctionFactory
       }).then(function (imageObj) {
@@ -43948,6 +43957,8 @@ var PDFImage = function PDFImageClosure() {
     var xref = _ref.xref,
         res = _ref.res,
         image = _ref.image,
+        _ref$isInline = _ref.isInline,
+        isInline = _ref$isInline === undefined ? false : _ref$isInline,
         _ref$smask = _ref.smask,
         smask = _ref$smask === undefined ? null : _ref$smask,
         _ref$mask = _ref.mask,
@@ -44009,7 +44020,8 @@ var PDFImage = function PDFImageClosure() {
             throw new Error('JPX images with ' + this.numComps + ' ' + 'color components not supported.');
         }
       }
-      this.colorSpace = _colorspace.ColorSpace.parse(colorSpace, xref, res, pdfFunctionFactory);
+      var resources = isInline ? res : null;
+      this.colorSpace = _colorspace.ColorSpace.parse(colorSpace, xref, resources, pdfFunctionFactory);
       this.numComps = this.colorSpace.numComps;
     }
     this.decode = dict.getArray('Decode', 'D');
@@ -44031,6 +44043,7 @@ var PDFImage = function PDFImageClosure() {
         xref: xref,
         res: res,
         image: smask,
+        isInline: isInline,
         pdfFunctionFactory: pdfFunctionFactory
       });
     } else if (mask) {
@@ -44044,6 +44057,7 @@ var PDFImage = function PDFImageClosure() {
             xref: xref,
             res: res,
             image: mask,
+            isInline: isInline,
             isMask: true,
             pdfFunctionFactory: pdfFunctionFactory
           });
@@ -44058,6 +44072,8 @@ var PDFImage = function PDFImageClosure() {
         xref = _ref2.xref,
         res = _ref2.res,
         image = _ref2.image,
+        _ref2$isInline = _ref2.isInline,
+        isInline = _ref2$isInline === undefined ? false : _ref2$isInline,
         _ref2$nativeDecoder = _ref2.nativeDecoder,
         nativeDecoder = _ref2$nativeDecoder === undefined ? null : _ref2$nativeDecoder,
         pdfFunctionFactory = _ref2.pdfFunctionFactory;
@@ -44095,6 +44111,7 @@ var PDFImage = function PDFImageClosure() {
         xref: xref,
         res: res,
         image: imageData,
+        isInline: isInline,
         smask: smaskData,
         mask: maskData,
         pdfFunctionFactory: pdfFunctionFactory

File diff suppressed because it is too large
+ 0 - 0
build/pdf.worker.js.map


File diff suppressed because it is too large
+ 0 - 0
build/pdf.worker.min.js


+ 17 - 10
lib/core/colorspace.js

@@ -189,16 +189,10 @@ var ColorSpace = function ColorSpaceClosure() {
         throw new _util.FormatError('Unknown colorspace name: ' + name);
     }
   };
-  ColorSpace.parseToIR = function (cs, xref, res, pdfFunctionFactory) {
-    if ((0, _primitives.isName)(cs)) {
-      var colorSpaces = res.get('ColorSpace');
-      if ((0, _primitives.isDict)(colorSpaces)) {
-        var refcs = colorSpaces.get(cs.name);
-        if (refcs) {
-          cs = refcs;
-        }
-      }
-    }
+  ColorSpace.parseToIR = function (cs, xref) {
+    var res = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
+    var pdfFunctionFactory = arguments[3];
+
     cs = xref.fetchIfRef(cs);
     if ((0, _primitives.isName)(cs)) {
       switch (cs.name) {
@@ -214,6 +208,19 @@ var ColorSpace = function ColorSpaceClosure() {
         case 'Pattern':
           return ['PatternCS', null];
         default:
+          if ((0, _primitives.isDict)(res)) {
+            var colorSpaces = res.get('ColorSpace');
+            if ((0, _primitives.isDict)(colorSpaces)) {
+              var resCS = colorSpaces.get(cs.name);
+              if (resCS) {
+                if ((0, _primitives.isName)(resCS)) {
+                  return ColorSpace.parseToIR(resCS, xref, res, pdfFunctionFactory);
+                }
+                cs = resCS;
+                break;
+              }
+            }
+          }
           throw new _util.FormatError('unrecognized colorspace ' + cs.name);
       }
     }

+ 2 - 0
lib/core/evaluator.js

@@ -377,6 +377,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
           xref: this.xref,
           res: resources,
           image: image,
+          isInline: inline,
           pdfFunctionFactory: this.pdfFunctionFactory
         });
         imgData = imageObj.createImageData(true);
@@ -413,6 +414,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
         xref: this.xref,
         res: resources,
         image: image,
+        isInline: inline,
         nativeDecoder: nativeImageDecoder,
         pdfFunctionFactory: this.pdfFunctionFactory
       }).then(function (imageObj) {

+ 9 - 1
lib/core/image.js

@@ -79,6 +79,8 @@ var PDFImage = function PDFImageClosure() {
     var xref = _ref.xref,
         res = _ref.res,
         image = _ref.image,
+        _ref$isInline = _ref.isInline,
+        isInline = _ref$isInline === undefined ? false : _ref$isInline,
         _ref$smask = _ref.smask,
         smask = _ref$smask === undefined ? null : _ref$smask,
         _ref$mask = _ref.mask,
@@ -140,7 +142,8 @@ var PDFImage = function PDFImageClosure() {
             throw new Error('JPX images with ' + this.numComps + ' ' + 'color components not supported.');
         }
       }
-      this.colorSpace = _colorspace.ColorSpace.parse(colorSpace, xref, res, pdfFunctionFactory);
+      var resources = isInline ? res : null;
+      this.colorSpace = _colorspace.ColorSpace.parse(colorSpace, xref, resources, pdfFunctionFactory);
       this.numComps = this.colorSpace.numComps;
     }
     this.decode = dict.getArray('Decode', 'D');
@@ -162,6 +165,7 @@ var PDFImage = function PDFImageClosure() {
         xref: xref,
         res: res,
         image: smask,
+        isInline: isInline,
         pdfFunctionFactory: pdfFunctionFactory
       });
     } else if (mask) {
@@ -175,6 +179,7 @@ var PDFImage = function PDFImageClosure() {
             xref: xref,
             res: res,
             image: mask,
+            isInline: isInline,
             isMask: true,
             pdfFunctionFactory: pdfFunctionFactory
           });
@@ -189,6 +194,8 @@ var PDFImage = function PDFImageClosure() {
         xref = _ref2.xref,
         res = _ref2.res,
         image = _ref2.image,
+        _ref2$isInline = _ref2.isInline,
+        isInline = _ref2$isInline === undefined ? false : _ref2$isInline,
         _ref2$nativeDecoder = _ref2.nativeDecoder,
         nativeDecoder = _ref2$nativeDecoder === undefined ? null : _ref2$nativeDecoder,
         pdfFunctionFactory = _ref2.pdfFunctionFactory;
@@ -226,6 +233,7 @@ var PDFImage = function PDFImageClosure() {
         xref: xref,
         res: res,
         image: imageData,
+        isInline: isInline,
         smask: smaskData,
         mask: maskData,
         pdfFunctionFactory: pdfFunctionFactory

+ 1 - 1
lib/core/worker.js

@@ -217,7 +217,7 @@ var WorkerMessageHandler = {
     var cancelXHRs = null;
     var WorkerTasks = [];
     var apiVersion = docParams.apiVersion;
-    var workerVersion = '2.0.258';
+    var workerVersion = '2.0.260';
     if (apiVersion !== null && apiVersion !== workerVersion) {
       throw new Error('The API version "' + apiVersion + '" does not match ' + ('the Worker version "' + workerVersion + '".'));
     }

+ 3 - 3
lib/display/api.js

@@ -178,7 +178,7 @@ function _fetchDocument(worker, source, pdfDataRangeTransport, docId) {
   if (worker.destroyed) {
     return Promise.reject(new Error('Worker was destroyed'));
   }
-  var apiVersion = '2.0.258';
+  var apiVersion = '2.0.260';
   source.disableRange = (0, _dom_utils.getDefaultSetting)('disableRange');
   source.disableAutoFetch = (0, _dom_utils.getDefaultSetting)('disableAutoFetch');
   source.disableStream = (0, _dom_utils.getDefaultSetting)('disableStream');
@@ -1551,8 +1551,8 @@ var InternalRenderTask = function InternalRenderTaskClosure() {
 }();
 var version, build;
 {
-  exports.version = version = '2.0.258';
-  exports.build = build = '5a52ee0a';
+  exports.version = version = '2.0.260';
+  exports.build = build = 'd77fc888';
 }
 exports.getDocument = getDocument;
 exports.LoopbackPort = LoopbackPort;

+ 2 - 2
lib/display/global.js

@@ -51,8 +51,8 @@ if (!_global_scope2.default.PDFJS) {
 }
 var PDFJS = _global_scope2.default.PDFJS;
 {
-  PDFJS.version = '2.0.258';
-  PDFJS.build = '5a52ee0a';
+  PDFJS.version = '2.0.260';
+  PDFJS.build = 'd77fc888';
 }
 PDFJS.pdfBug = false;
 if (PDFJS.verbosity !== undefined) {

+ 2 - 2
lib/pdf.js

@@ -21,8 +21,8 @@
  */
 'use strict';
 
-var pdfjsVersion = '2.0.258';
-var pdfjsBuild = '5a52ee0a';
+var pdfjsVersion = '2.0.260';
+var pdfjsBuild = 'd77fc888';
 var pdfjsSharedUtil = require('./shared/util.js');
 var pdfjsDisplayGlobal = require('./display/global.js');
 var pdfjsDisplayAPI = require('./display/api.js');

+ 2 - 2
lib/pdf.worker.js

@@ -21,7 +21,7 @@
  */
 'use strict';
 
-var pdfjsVersion = '2.0.258';
-var pdfjsBuild = '5a52ee0a';
+var pdfjsVersion = '2.0.260';
+var pdfjsBuild = 'd77fc888';
 var pdfjsCoreWorker = require('./core/worker.js');
 exports.WorkerMessageHandler = pdfjsCoreWorker.WorkerMessageHandler;

+ 1 - 1
package.json

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

Some files were not shown because too many files changed in this diff