Browse Source

PDF.js version 1.9.570 - See mozilla/pdf.js@f01f0fdaa78bc04dbf154dab5102cc5cdabcd4ac

pdfjsbot 7 years ago
parent
commit
aa196ac33a

+ 1 - 1
bower.json

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

+ 65 - 21
build/pdf.combined.js

@@ -13490,8 +13490,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() {
 }();
 var version, build;
 {
-  exports.version = version = '1.9.568';
-  exports.build = build = '3be941d9';
+  exports.version = version = '1.9.570';
+  exports.build = build = 'f01f0fda';
 }
 exports.getDocument = getDocument;
 exports.LoopbackPort = LoopbackPort;
@@ -26909,6 +26909,8 @@ var AnnotationElementFactory = function () {
           return new SquigglyAnnotationElement(parameters);
         case _util.AnnotationType.STRIKEOUT:
           return new StrikeOutAnnotationElement(parameters);
+        case _util.AnnotationType.STAMP:
+          return new StampAnnotationElement(parameters);
         case _util.AnnotationType.FILEATTACHMENT:
           return new FileAttachmentAnnotationElement(parameters);
         default:
@@ -27653,23 +27655,47 @@ var StrikeOutAnnotationElement = function (_AnnotationElement11) {
   return StrikeOutAnnotationElement;
 }(AnnotationElement);
 
-var FileAttachmentAnnotationElement = function (_AnnotationElement12) {
-  _inherits(FileAttachmentAnnotationElement, _AnnotationElement12);
+var StampAnnotationElement = function (_AnnotationElement12) {
+  _inherits(StampAnnotationElement, _AnnotationElement12);
+
+  function StampAnnotationElement(parameters) {
+    _classCallCheck(this, StampAnnotationElement);
+
+    var isRenderable = !!(parameters.data.hasPopup || parameters.data.title || parameters.data.contents);
+    return _possibleConstructorReturn(this, (StampAnnotationElement.__proto__ || Object.getPrototypeOf(StampAnnotationElement)).call(this, parameters, isRenderable, true));
+  }
+
+  _createClass(StampAnnotationElement, [{
+    key: 'render',
+    value: function render() {
+      this.container.className = 'stampAnnotation';
+      if (!this.data.hasPopup) {
+        this._createPopup(this.container, null, this.data);
+      }
+      return this.container;
+    }
+  }]);
+
+  return StampAnnotationElement;
+}(AnnotationElement);
+
+var FileAttachmentAnnotationElement = function (_AnnotationElement13) {
+  _inherits(FileAttachmentAnnotationElement, _AnnotationElement13);
 
   function FileAttachmentAnnotationElement(parameters) {
     _classCallCheck(this, FileAttachmentAnnotationElement);
 
-    var _this18 = _possibleConstructorReturn(this, (FileAttachmentAnnotationElement.__proto__ || Object.getPrototypeOf(FileAttachmentAnnotationElement)).call(this, parameters, true));
+    var _this19 = _possibleConstructorReturn(this, (FileAttachmentAnnotationElement.__proto__ || Object.getPrototypeOf(FileAttachmentAnnotationElement)).call(this, parameters, true));
 
-    var file = _this18.data.file;
-    _this18.filename = (0, _dom_utils.getFilenameFromUrl)(file.filename);
-    _this18.content = file.content;
-    _this18.linkService.onFileAttachmentAnnotation({
+    var file = _this19.data.file;
+    _this19.filename = (0, _dom_utils.getFilenameFromUrl)(file.filename);
+    _this19.content = file.content;
+    _this19.linkService.onFileAttachmentAnnotation({
       id: (0, _util.stringToPDFString)(file.filename),
       filename: file.filename,
       content: file.content
     });
-    return _this18;
+    return _this19;
   }
 
   _createClass(FileAttachmentAnnotationElement, [{
@@ -29328,8 +29354,8 @@ exports.SVGGraphics = SVGGraphics;
 "use strict";
 
 
-var pdfjsVersion = '1.9.568';
-var pdfjsBuild = '3be941d9';
+var pdfjsVersion = '1.9.570';
+var pdfjsBuild = 'f01f0fda';
 var pdfjsSharedUtil = __w_pdfjs_require__(0);
 var pdfjsDisplayGlobal = __w_pdfjs_require__(98);
 var pdfjsDisplayAPI = __w_pdfjs_require__(55);
@@ -35191,8 +35217,8 @@ if (!_global_scope2.default.PDFJS) {
 }
 var PDFJS = _global_scope2.default.PDFJS;
 {
-  PDFJS.version = '1.9.568';
-  PDFJS.build = '3be941d9';
+  PDFJS.version = '1.9.570';
+  PDFJS.build = 'f01f0fda';
 }
 PDFJS.pdfBug = false;
 if (PDFJS.verbosity !== undefined) {
@@ -50799,6 +50825,8 @@ var AnnotationFactory = function () {
           return new SquigglyAnnotation(parameters);
         case 'StrikeOut':
           return new StrikeOutAnnotation(parameters);
+        case 'Stamp':
+          return new StampAnnotation(parameters);
         case 'FileAttachment':
           return new FileAttachmentAnnotation(parameters);
         default:
@@ -51523,19 +51551,35 @@ var StrikeOutAnnotation = function (_Annotation11) {
   return StrikeOutAnnotation;
 }(Annotation);
 
-var FileAttachmentAnnotation = function (_Annotation12) {
-  _inherits(FileAttachmentAnnotation, _Annotation12);
+var StampAnnotation = function (_Annotation12) {
+  _inherits(StampAnnotation, _Annotation12);
+
+  function StampAnnotation(parameters) {
+    _classCallCheck(this, StampAnnotation);
+
+    var _this16 = _possibleConstructorReturn(this, (StampAnnotation.__proto__ || Object.getPrototypeOf(StampAnnotation)).call(this, parameters));
+
+    _this16.data.annotationType = _util.AnnotationType.STAMP;
+    _this16._preparePopup(parameters.dict);
+    return _this16;
+  }
+
+  return StampAnnotation;
+}(Annotation);
+
+var FileAttachmentAnnotation = function (_Annotation13) {
+  _inherits(FileAttachmentAnnotation, _Annotation13);
 
   function FileAttachmentAnnotation(parameters) {
     _classCallCheck(this, FileAttachmentAnnotation);
 
-    var _this16 = _possibleConstructorReturn(this, (FileAttachmentAnnotation.__proto__ || Object.getPrototypeOf(FileAttachmentAnnotation)).call(this, parameters));
+    var _this17 = _possibleConstructorReturn(this, (FileAttachmentAnnotation.__proto__ || Object.getPrototypeOf(FileAttachmentAnnotation)).call(this, parameters));
 
     var file = new _obj.FileSpec(parameters.dict.get('FS'), parameters.xref);
-    _this16.data.annotationType = _util.AnnotationType.FILEATTACHMENT;
-    _this16.data.file = file.serializable;
-    _this16._preparePopup(parameters.dict);
-    return _this16;
+    _this17.data.annotationType = _util.AnnotationType.FILEATTACHMENT;
+    _this17.data.file = file.serializable;
+    _this17._preparePopup(parameters.dict);
+    return _this17;
   }
 
   return FileAttachmentAnnotation;

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


+ 40 - 14
build/pdf.js

@@ -4204,8 +4204,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() {
 }();
 var version, build;
 {
-  exports.version = version = '1.9.568';
-  exports.build = build = '3be941d9';
+  exports.version = version = '1.9.570';
+  exports.build = build = 'f01f0fda';
 }
 exports.getDocument = getDocument;
 exports.LoopbackPort = LoopbackPort;
@@ -4736,6 +4736,8 @@ var AnnotationElementFactory = function () {
           return new SquigglyAnnotationElement(parameters);
         case _util.AnnotationType.STRIKEOUT:
           return new StrikeOutAnnotationElement(parameters);
+        case _util.AnnotationType.STAMP:
+          return new StampAnnotationElement(parameters);
         case _util.AnnotationType.FILEATTACHMENT:
           return new FileAttachmentAnnotationElement(parameters);
         default:
@@ -5480,23 +5482,47 @@ var StrikeOutAnnotationElement = function (_AnnotationElement11) {
   return StrikeOutAnnotationElement;
 }(AnnotationElement);
 
-var FileAttachmentAnnotationElement = function (_AnnotationElement12) {
-  _inherits(FileAttachmentAnnotationElement, _AnnotationElement12);
+var StampAnnotationElement = function (_AnnotationElement12) {
+  _inherits(StampAnnotationElement, _AnnotationElement12);
+
+  function StampAnnotationElement(parameters) {
+    _classCallCheck(this, StampAnnotationElement);
+
+    var isRenderable = !!(parameters.data.hasPopup || parameters.data.title || parameters.data.contents);
+    return _possibleConstructorReturn(this, (StampAnnotationElement.__proto__ || Object.getPrototypeOf(StampAnnotationElement)).call(this, parameters, isRenderable, true));
+  }
+
+  _createClass(StampAnnotationElement, [{
+    key: 'render',
+    value: function render() {
+      this.container.className = 'stampAnnotation';
+      if (!this.data.hasPopup) {
+        this._createPopup(this.container, null, this.data);
+      }
+      return this.container;
+    }
+  }]);
+
+  return StampAnnotationElement;
+}(AnnotationElement);
+
+var FileAttachmentAnnotationElement = function (_AnnotationElement13) {
+  _inherits(FileAttachmentAnnotationElement, _AnnotationElement13);
 
   function FileAttachmentAnnotationElement(parameters) {
     _classCallCheck(this, FileAttachmentAnnotationElement);
 
-    var _this18 = _possibleConstructorReturn(this, (FileAttachmentAnnotationElement.__proto__ || Object.getPrototypeOf(FileAttachmentAnnotationElement)).call(this, parameters, true));
+    var _this19 = _possibleConstructorReturn(this, (FileAttachmentAnnotationElement.__proto__ || Object.getPrototypeOf(FileAttachmentAnnotationElement)).call(this, parameters, true));
 
-    var file = _this18.data.file;
-    _this18.filename = (0, _dom_utils.getFilenameFromUrl)(file.filename);
-    _this18.content = file.content;
-    _this18.linkService.onFileAttachmentAnnotation({
+    var file = _this19.data.file;
+    _this19.filename = (0, _dom_utils.getFilenameFromUrl)(file.filename);
+    _this19.content = file.content;
+    _this19.linkService.onFileAttachmentAnnotation({
       id: (0, _util.stringToPDFString)(file.filename),
       filename: file.filename,
       content: file.content
     });
-    return _this18;
+    return _this19;
   }
 
   _createClass(FileAttachmentAnnotationElement, [{
@@ -7156,8 +7182,8 @@ exports.SVGGraphics = SVGGraphics;
 "use strict";
 
 
-var pdfjsVersion = '1.9.568';
-var pdfjsBuild = '3be941d9';
+var pdfjsVersion = '1.9.570';
+var pdfjsBuild = 'f01f0fda';
 var pdfjsSharedUtil = __w_pdfjs_require__(0);
 var pdfjsDisplayGlobal = __w_pdfjs_require__(82);
 var pdfjsDisplayAPI = __w_pdfjs_require__(48);
@@ -13019,8 +13045,8 @@ if (!_global_scope2.default.PDFJS) {
 }
 var PDFJS = _global_scope2.default.PDFJS;
 {
-  PDFJS.version = '1.9.568';
-  PDFJS.build = '3be941d9';
+  PDFJS.version = '1.9.570';
+  PDFJS.build = 'f01f0fda';
 }
 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


+ 27 - 9
build/pdf.worker.js

@@ -24529,8 +24529,8 @@ exports.getUnicodeForGlyph = getUnicodeForGlyph;
 "use strict";
 
 
-var pdfjsVersion = '1.9.568';
-var pdfjsBuild = '3be941d9';
+var pdfjsVersion = '1.9.570';
+var pdfjsBuild = 'f01f0fda';
 var pdfjsCoreWorker = __w_pdfjs_require__(62);
 exports.WorkerMessageHandler = pdfjsCoreWorker.WorkerMessageHandler;
 
@@ -43167,6 +43167,8 @@ var AnnotationFactory = function () {
           return new SquigglyAnnotation(parameters);
         case 'StrikeOut':
           return new StrikeOutAnnotation(parameters);
+        case 'Stamp':
+          return new StampAnnotation(parameters);
         case 'FileAttachment':
           return new FileAttachmentAnnotation(parameters);
         default:
@@ -43891,19 +43893,35 @@ var StrikeOutAnnotation = function (_Annotation11) {
   return StrikeOutAnnotation;
 }(Annotation);
 
-var FileAttachmentAnnotation = function (_Annotation12) {
-  _inherits(FileAttachmentAnnotation, _Annotation12);
+var StampAnnotation = function (_Annotation12) {
+  _inherits(StampAnnotation, _Annotation12);
+
+  function StampAnnotation(parameters) {
+    _classCallCheck(this, StampAnnotation);
+
+    var _this16 = _possibleConstructorReturn(this, (StampAnnotation.__proto__ || Object.getPrototypeOf(StampAnnotation)).call(this, parameters));
+
+    _this16.data.annotationType = _util.AnnotationType.STAMP;
+    _this16._preparePopup(parameters.dict);
+    return _this16;
+  }
+
+  return StampAnnotation;
+}(Annotation);
+
+var FileAttachmentAnnotation = function (_Annotation13) {
+  _inherits(FileAttachmentAnnotation, _Annotation13);
 
   function FileAttachmentAnnotation(parameters) {
     _classCallCheck(this, FileAttachmentAnnotation);
 
-    var _this16 = _possibleConstructorReturn(this, (FileAttachmentAnnotation.__proto__ || Object.getPrototypeOf(FileAttachmentAnnotation)).call(this, parameters));
+    var _this17 = _possibleConstructorReturn(this, (FileAttachmentAnnotation.__proto__ || Object.getPrototypeOf(FileAttachmentAnnotation)).call(this, parameters));
 
     var file = new _obj.FileSpec(parameters.dict.get('FS'), parameters.xref);
-    _this16.data.annotationType = _util.AnnotationType.FILEATTACHMENT;
-    _this16.data.file = file.serializable;
-    _this16._preparePopup(parameters.dict);
-    return _this16;
+    _this17.data.annotationType = _util.AnnotationType.FILEATTACHMENT;
+    _this17.data.file = file.serializable;
+    _this17._preparePopup(parameters.dict);
+    return _this17;
   }
 
   return FileAttachmentAnnotation;

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


+ 25 - 7
lib/core/annotation.js

@@ -98,6 +98,8 @@ var AnnotationFactory = function () {
           return new SquigglyAnnotation(parameters);
         case 'StrikeOut':
           return new StrikeOutAnnotation(parameters);
+        case 'Stamp':
+          return new StampAnnotation(parameters);
         case 'FileAttachment':
           return new FileAttachmentAnnotation(parameters);
         default:
@@ -822,19 +824,35 @@ var StrikeOutAnnotation = function (_Annotation11) {
   return StrikeOutAnnotation;
 }(Annotation);
 
-var FileAttachmentAnnotation = function (_Annotation12) {
-  _inherits(FileAttachmentAnnotation, _Annotation12);
+var StampAnnotation = function (_Annotation12) {
+  _inherits(StampAnnotation, _Annotation12);
+
+  function StampAnnotation(parameters) {
+    _classCallCheck(this, StampAnnotation);
+
+    var _this16 = _possibleConstructorReturn(this, (StampAnnotation.__proto__ || Object.getPrototypeOf(StampAnnotation)).call(this, parameters));
+
+    _this16.data.annotationType = _util.AnnotationType.STAMP;
+    _this16._preparePopup(parameters.dict);
+    return _this16;
+  }
+
+  return StampAnnotation;
+}(Annotation);
+
+var FileAttachmentAnnotation = function (_Annotation13) {
+  _inherits(FileAttachmentAnnotation, _Annotation13);
 
   function FileAttachmentAnnotation(parameters) {
     _classCallCheck(this, FileAttachmentAnnotation);
 
-    var _this16 = _possibleConstructorReturn(this, (FileAttachmentAnnotation.__proto__ || Object.getPrototypeOf(FileAttachmentAnnotation)).call(this, parameters));
+    var _this17 = _possibleConstructorReturn(this, (FileAttachmentAnnotation.__proto__ || Object.getPrototypeOf(FileAttachmentAnnotation)).call(this, parameters));
 
     var file = new _obj.FileSpec(parameters.dict.get('FS'), parameters.xref);
-    _this16.data.annotationType = _util.AnnotationType.FILEATTACHMENT;
-    _this16.data.file = file.serializable;
-    _this16._preparePopup(parameters.dict);
-    return _this16;
+    _this17.data.annotationType = _util.AnnotationType.FILEATTACHMENT;
+    _this17.data.file = file.serializable;
+    _this17._preparePopup(parameters.dict);
+    return _this17;
   }
 
   return FileAttachmentAnnotation;

+ 34 - 8
lib/display/annotation_layer.js

@@ -78,6 +78,8 @@ var AnnotationElementFactory = function () {
           return new SquigglyAnnotationElement(parameters);
         case _util.AnnotationType.STRIKEOUT:
           return new StrikeOutAnnotationElement(parameters);
+        case _util.AnnotationType.STAMP:
+          return new StampAnnotationElement(parameters);
         case _util.AnnotationType.FILEATTACHMENT:
           return new FileAttachmentAnnotationElement(parameters);
         default:
@@ -822,23 +824,47 @@ var StrikeOutAnnotationElement = function (_AnnotationElement11) {
   return StrikeOutAnnotationElement;
 }(AnnotationElement);
 
-var FileAttachmentAnnotationElement = function (_AnnotationElement12) {
-  _inherits(FileAttachmentAnnotationElement, _AnnotationElement12);
+var StampAnnotationElement = function (_AnnotationElement12) {
+  _inherits(StampAnnotationElement, _AnnotationElement12);
+
+  function StampAnnotationElement(parameters) {
+    _classCallCheck(this, StampAnnotationElement);
+
+    var isRenderable = !!(parameters.data.hasPopup || parameters.data.title || parameters.data.contents);
+    return _possibleConstructorReturn(this, (StampAnnotationElement.__proto__ || Object.getPrototypeOf(StampAnnotationElement)).call(this, parameters, isRenderable, true));
+  }
+
+  _createClass(StampAnnotationElement, [{
+    key: 'render',
+    value: function render() {
+      this.container.className = 'stampAnnotation';
+      if (!this.data.hasPopup) {
+        this._createPopup(this.container, null, this.data);
+      }
+      return this.container;
+    }
+  }]);
+
+  return StampAnnotationElement;
+}(AnnotationElement);
+
+var FileAttachmentAnnotationElement = function (_AnnotationElement13) {
+  _inherits(FileAttachmentAnnotationElement, _AnnotationElement13);
 
   function FileAttachmentAnnotationElement(parameters) {
     _classCallCheck(this, FileAttachmentAnnotationElement);
 
-    var _this18 = _possibleConstructorReturn(this, (FileAttachmentAnnotationElement.__proto__ || Object.getPrototypeOf(FileAttachmentAnnotationElement)).call(this, parameters, true));
+    var _this19 = _possibleConstructorReturn(this, (FileAttachmentAnnotationElement.__proto__ || Object.getPrototypeOf(FileAttachmentAnnotationElement)).call(this, parameters, true));
 
-    var file = _this18.data.file;
-    _this18.filename = (0, _dom_utils.getFilenameFromUrl)(file.filename);
-    _this18.content = file.content;
-    _this18.linkService.onFileAttachmentAnnotation({
+    var file = _this19.data.file;
+    _this19.filename = (0, _dom_utils.getFilenameFromUrl)(file.filename);
+    _this19.content = file.content;
+    _this19.linkService.onFileAttachmentAnnotation({
       id: (0, _util.stringToPDFString)(file.filename),
       filename: file.filename,
       content: file.content
     });
-    return _this18;
+    return _this19;
   }
 
   _createClass(FileAttachmentAnnotationElement, [{

+ 2 - 2
lib/display/api.js

@@ -1582,8 +1582,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() {
 }();
 var version, build;
 {
-  exports.version = version = '1.9.568';
-  exports.build = build = '3be941d9';
+  exports.version = version = '1.9.570';
+  exports.build = build = 'f01f0fda';
 }
 exports.getDocument = getDocument;
 exports.LoopbackPort = LoopbackPort;

+ 2 - 2
lib/display/global.js

@@ -45,8 +45,8 @@ if (!_global_scope2.default.PDFJS) {
 }
 var PDFJS = _global_scope2.default.PDFJS;
 {
-  PDFJS.version = '1.9.568';
-  PDFJS.build = '3be941d9';
+  PDFJS.version = '1.9.570';
+  PDFJS.build = 'f01f0fda';
 }
 PDFJS.pdfBug = false;
 if (PDFJS.verbosity !== undefined) {

+ 2 - 2
lib/pdf.js

@@ -14,8 +14,8 @@
  */
 'use strict';
 
-var pdfjsVersion = '1.9.568';
-var pdfjsBuild = '3be941d9';
+var pdfjsVersion = '1.9.570';
+var pdfjsBuild = 'f01f0fda';
 var pdfjsSharedUtil = require('./shared/util.js');
 var pdfjsDisplayGlobal = require('./display/global.js');
 var pdfjsDisplayAPI = require('./display/api.js');

+ 2 - 2
lib/pdf.worker.js

@@ -14,7 +14,7 @@
  */
 'use strict';
 
-var pdfjsVersion = '1.9.568';
-var pdfjsBuild = '3be941d9';
+var pdfjsVersion = '1.9.570';
+var pdfjsBuild = 'f01f0fda';
 var pdfjsCoreWorker = require('./core/worker.js');
 exports.WorkerMessageHandler = pdfjsCoreWorker.WorkerMessageHandler;

+ 1 - 1
package.json

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

+ 1 - 0
web/pdf_viewer.css

@@ -260,6 +260,7 @@
 .annotationLayer .lineAnnotation svg line,
 .annotationLayer .squareAnnotation svg rect,
 .annotationLayer .circleAnnotation svg ellipse,
+.annotationLayer .stampAnnotation,
 .annotationLayer .fileAttachmentAnnotation {
   cursor: pointer;
 }

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