|
@@ -19,6 +19,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
});
|
|
|
exports.AnnotationFactory = exports.AnnotationBorderStyle = exports.Annotation = undefined;
|
|
|
|
|
|
+var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
|
|
|
+
|
|
|
+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 _util = require('../shared/util');
|
|
|
|
|
|
var _obj = require('./obj');
|
|
@@ -31,132 +35,153 @@ var _evaluator = require('./evaluator');
|
|
|
|
|
|
var _stream = require('./stream');
|
|
|
|
|
|
-function AnnotationFactory() {}
|
|
|
-AnnotationFactory.prototype = {
|
|
|
- create: function AnnotationFactory_create(xref, ref, pdfManager, idFactory) {
|
|
|
- var dict = xref.fetchIfRef(ref);
|
|
|
- if (!(0, _primitives.isDict)(dict)) {
|
|
|
- return;
|
|
|
- }
|
|
|
- var id = (0, _primitives.isRef)(ref) ? ref.toString() : 'annot_' + idFactory.createObjId();
|
|
|
- var subtype = dict.get('Subtype');
|
|
|
- subtype = (0, _primitives.isName)(subtype) ? subtype.name : null;
|
|
|
- var parameters = {
|
|
|
- xref: xref,
|
|
|
- dict: dict,
|
|
|
- ref: (0, _primitives.isRef)(ref) ? ref : null,
|
|
|
- subtype: subtype,
|
|
|
- id: id,
|
|
|
- pdfManager: pdfManager
|
|
|
- };
|
|
|
- switch (subtype) {
|
|
|
- case 'Link':
|
|
|
- return new LinkAnnotation(parameters);
|
|
|
- case 'Text':
|
|
|
- return new TextAnnotation(parameters);
|
|
|
- case 'Widget':
|
|
|
- var fieldType = _util.Util.getInheritableProperty(dict, 'FT');
|
|
|
- fieldType = (0, _primitives.isName)(fieldType) ? fieldType.name : null;
|
|
|
- switch (fieldType) {
|
|
|
- case 'Tx':
|
|
|
- return new TextWidgetAnnotation(parameters);
|
|
|
- case 'Btn':
|
|
|
- return new ButtonWidgetAnnotation(parameters);
|
|
|
- case 'Ch':
|
|
|
- return new ChoiceWidgetAnnotation(parameters);
|
|
|
- }
|
|
|
- (0, _util.warn)('Unimplemented widget field type "' + fieldType + '", ' + 'falling back to base field type.');
|
|
|
- return new WidgetAnnotation(parameters);
|
|
|
- case 'Popup':
|
|
|
- return new PopupAnnotation(parameters);
|
|
|
- case 'Line':
|
|
|
- return new LineAnnotation(parameters);
|
|
|
- case 'Highlight':
|
|
|
- return new HighlightAnnotation(parameters);
|
|
|
- case 'Underline':
|
|
|
- return new UnderlineAnnotation(parameters);
|
|
|
- case 'Squiggly':
|
|
|
- return new SquigglyAnnotation(parameters);
|
|
|
- case 'StrikeOut':
|
|
|
- return new StrikeOutAnnotation(parameters);
|
|
|
- case 'FileAttachment':
|
|
|
- return new FileAttachmentAnnotation(parameters);
|
|
|
- default:
|
|
|
- if (!subtype) {
|
|
|
- (0, _util.warn)('Annotation is missing the required /Subtype.');
|
|
|
- } else {
|
|
|
- (0, _util.warn)('Unimplemented annotation type "' + subtype + '", ' + 'falling back to base annotation.');
|
|
|
- }
|
|
|
- return new Annotation(parameters);
|
|
|
- }
|
|
|
+function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
|
+
|
|
|
+function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
|
+
|
|
|
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
|
+
|
|
|
+var AnnotationFactory = function () {
|
|
|
+ function AnnotationFactory() {
|
|
|
+ _classCallCheck(this, AnnotationFactory);
|
|
|
}
|
|
|
-};
|
|
|
-var Annotation = function AnnotationClosure() {
|
|
|
- function getTransformMatrix(rect, bbox, matrix) {
|
|
|
- var bounds = _util.Util.getAxialAlignedBoundingBox(bbox, matrix);
|
|
|
- var minX = bounds[0];
|
|
|
- var minY = bounds[1];
|
|
|
- var maxX = bounds[2];
|
|
|
- var maxY = bounds[3];
|
|
|
- if (minX === maxX || minY === maxY) {
|
|
|
- return [1, 0, 0, 1, rect[0], rect[1]];
|
|
|
- }
|
|
|
- var xRatio = (rect[2] - rect[0]) / (maxX - minX);
|
|
|
- var yRatio = (rect[3] - rect[1]) / (maxY - minY);
|
|
|
- return [xRatio, 0, 0, yRatio, rect[0] - minX * xRatio, rect[1] - minY * yRatio];
|
|
|
+
|
|
|
+ _createClass(AnnotationFactory, null, [{
|
|
|
+ key: 'create',
|
|
|
+ value: function create(xref, ref, pdfManager, idFactory) {
|
|
|
+ var dict = xref.fetchIfRef(ref);
|
|
|
+ if (!(0, _primitives.isDict)(dict)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ var id = (0, _primitives.isRef)(ref) ? ref.toString() : 'annot_' + idFactory.createObjId();
|
|
|
+ var subtype = dict.get('Subtype');
|
|
|
+ subtype = (0, _primitives.isName)(subtype) ? subtype.name : null;
|
|
|
+ var parameters = {
|
|
|
+ xref: xref,
|
|
|
+ dict: dict,
|
|
|
+ ref: (0, _primitives.isRef)(ref) ? ref : null,
|
|
|
+ subtype: subtype,
|
|
|
+ id: id,
|
|
|
+ pdfManager: pdfManager
|
|
|
+ };
|
|
|
+ switch (subtype) {
|
|
|
+ case 'Link':
|
|
|
+ return new LinkAnnotation(parameters);
|
|
|
+ case 'Text':
|
|
|
+ return new TextAnnotation(parameters);
|
|
|
+ case 'Widget':
|
|
|
+ var fieldType = _util.Util.getInheritableProperty(dict, 'FT');
|
|
|
+ fieldType = (0, _primitives.isName)(fieldType) ? fieldType.name : null;
|
|
|
+ switch (fieldType) {
|
|
|
+ case 'Tx':
|
|
|
+ return new TextWidgetAnnotation(parameters);
|
|
|
+ case 'Btn':
|
|
|
+ return new ButtonWidgetAnnotation(parameters);
|
|
|
+ case 'Ch':
|
|
|
+ return new ChoiceWidgetAnnotation(parameters);
|
|
|
+ }
|
|
|
+ (0, _util.warn)('Unimplemented widget field type "' + fieldType + '", ' + 'falling back to base field type.');
|
|
|
+ return new WidgetAnnotation(parameters);
|
|
|
+ case 'Popup':
|
|
|
+ return new PopupAnnotation(parameters);
|
|
|
+ case 'Line':
|
|
|
+ return new LineAnnotation(parameters);
|
|
|
+ case 'Highlight':
|
|
|
+ return new HighlightAnnotation(parameters);
|
|
|
+ case 'Underline':
|
|
|
+ return new UnderlineAnnotation(parameters);
|
|
|
+ case 'Squiggly':
|
|
|
+ return new SquigglyAnnotation(parameters);
|
|
|
+ case 'StrikeOut':
|
|
|
+ return new StrikeOutAnnotation(parameters);
|
|
|
+ case 'FileAttachment':
|
|
|
+ return new FileAttachmentAnnotation(parameters);
|
|
|
+ default:
|
|
|
+ if (!subtype) {
|
|
|
+ (0, _util.warn)('Annotation is missing the required /Subtype.');
|
|
|
+ } else {
|
|
|
+ (0, _util.warn)('Unimplemented annotation type "' + subtype + '", ' + 'falling back to base annotation.');
|
|
|
+ }
|
|
|
+ return new Annotation(parameters);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }]);
|
|
|
+
|
|
|
+ return AnnotationFactory;
|
|
|
+}();
|
|
|
+
|
|
|
+function getTransformMatrix(rect, bbox, matrix) {
|
|
|
+ var bounds = _util.Util.getAxialAlignedBoundingBox(bbox, matrix);
|
|
|
+ var minX = bounds[0];
|
|
|
+ var minY = bounds[1];
|
|
|
+ var maxX = bounds[2];
|
|
|
+ var maxY = bounds[3];
|
|
|
+ if (minX === maxX || minY === maxY) {
|
|
|
+ return [1, 0, 0, 1, rect[0], rect[1]];
|
|
|
}
|
|
|
+ var xRatio = (rect[2] - rect[0]) / (maxX - minX);
|
|
|
+ var yRatio = (rect[3] - rect[1]) / (maxY - minY);
|
|
|
+ return [xRatio, 0, 0, yRatio, rect[0] - minX * xRatio, rect[1] - minY * yRatio];
|
|
|
+}
|
|
|
+
|
|
|
+var Annotation = function () {
|
|
|
function Annotation(params) {
|
|
|
+ _classCallCheck(this, Annotation);
|
|
|
+
|
|
|
var dict = params.dict;
|
|
|
this.setFlags(dict.get('F'));
|
|
|
this.setRectangle(dict.getArray('Rect'));
|
|
|
this.setColor(dict.getArray('C'));
|
|
|
this.setBorderStyle(dict);
|
|
|
this.setAppearance(dict);
|
|
|
- this.data = {};
|
|
|
- this.data.id = params.id;
|
|
|
- this.data.subtype = params.subtype;
|
|
|
- this.data.annotationFlags = this.flags;
|
|
|
- this.data.rect = this.rectangle;
|
|
|
- this.data.color = this.color;
|
|
|
- this.data.borderStyle = this.borderStyle;
|
|
|
- this.data.hasAppearance = !!this.appearance;
|
|
|
+ this.data = {
|
|
|
+ annotationFlags: this.flags,
|
|
|
+ borderStyle: this.borderStyle,
|
|
|
+ color: this.color,
|
|
|
+ hasAppearance: !!this.appearance,
|
|
|
+ id: params.id,
|
|
|
+ rect: this.rectangle,
|
|
|
+ subtype: params.subtype
|
|
|
+ };
|
|
|
}
|
|
|
- Annotation.prototype = {
|
|
|
- _hasFlag: function Annotation_hasFlag(flags, flag) {
|
|
|
+
|
|
|
+ _createClass(Annotation, [{
|
|
|
+ key: '_hasFlag',
|
|
|
+ value: function _hasFlag(flags, flag) {
|
|
|
return !!(flags & flag);
|
|
|
- },
|
|
|
- _isViewable: function Annotation_isViewable(flags) {
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ key: '_isViewable',
|
|
|
+ value: function _isViewable(flags) {
|
|
|
return !this._hasFlag(flags, _util.AnnotationFlag.INVISIBLE) && !this._hasFlag(flags, _util.AnnotationFlag.HIDDEN) && !this._hasFlag(flags, _util.AnnotationFlag.NOVIEW);
|
|
|
- },
|
|
|
- _isPrintable: function AnnotationFlag_isPrintable(flags) {
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ key: '_isPrintable',
|
|
|
+ value: function _isPrintable(flags) {
|
|
|
return this._hasFlag(flags, _util.AnnotationFlag.PRINT) && !this._hasFlag(flags, _util.AnnotationFlag.INVISIBLE) && !this._hasFlag(flags, _util.AnnotationFlag.HIDDEN);
|
|
|
- },
|
|
|
- get viewable() {
|
|
|
- if (this.flags === 0) {
|
|
|
- return true;
|
|
|
- }
|
|
|
- return this._isViewable(this.flags);
|
|
|
- },
|
|
|
- get printable() {
|
|
|
- if (this.flags === 0) {
|
|
|
- return false;
|
|
|
- }
|
|
|
- return this._isPrintable(this.flags);
|
|
|
- },
|
|
|
- setFlags: function Annotation_setFlags(flags) {
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ key: 'setFlags',
|
|
|
+ value: function setFlags(flags) {
|
|
|
this.flags = (0, _util.isInt)(flags) && flags > 0 ? flags : 0;
|
|
|
- },
|
|
|
- hasFlag: function Annotation_hasFlag(flag) {
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ key: 'hasFlag',
|
|
|
+ value: function hasFlag(flag) {
|
|
|
return this._hasFlag(this.flags, flag);
|
|
|
- },
|
|
|
- setRectangle: function Annotation_setRectangle(rectangle) {
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ key: 'setRectangle',
|
|
|
+ value: function setRectangle(rectangle) {
|
|
|
if ((0, _util.isArray)(rectangle) && rectangle.length === 4) {
|
|
|
this.rectangle = _util.Util.normalizeRect(rectangle);
|
|
|
} else {
|
|
|
this.rectangle = [0, 0, 0, 0];
|
|
|
}
|
|
|
- },
|
|
|
- setColor: function Annotation_setColor(color) {
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ key: 'setColor',
|
|
|
+ value: function setColor(color) {
|
|
|
var rgbColor = new Uint8Array(3);
|
|
|
if (!(0, _util.isArray)(color)) {
|
|
|
this.color = rgbColor;
|
|
@@ -182,8 +207,10 @@ var Annotation = function AnnotationClosure() {
|
|
|
this.color = rgbColor;
|
|
|
break;
|
|
|
}
|
|
|
- },
|
|
|
- setBorderStyle: function Annotation_setBorderStyle(borderStyle) {
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ key: 'setBorderStyle',
|
|
|
+ value: function setBorderStyle(borderStyle) {
|
|
|
this.borderStyle = new AnnotationBorderStyle();
|
|
|
if (!(0, _primitives.isDict)(borderStyle)) {
|
|
|
return;
|
|
@@ -209,8 +236,10 @@ var Annotation = function AnnotationClosure() {
|
|
|
} else {
|
|
|
this.borderStyle.setWidth(0);
|
|
|
}
|
|
|
- },
|
|
|
- setAppearance: function Annotation_setAppearance(dict) {
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ key: 'setAppearance',
|
|
|
+ value: function setAppearance(dict) {
|
|
|
this.appearance = null;
|
|
|
var appearanceStates = dict.get('AP');
|
|
|
if (!(0, _primitives.isDict)(appearanceStates)) {
|
|
@@ -229,16 +258,20 @@ var Annotation = function AnnotationClosure() {
|
|
|
return;
|
|
|
}
|
|
|
this.appearance = normalAppearanceState.get(as.name);
|
|
|
- },
|
|
|
- _preparePopup: function Annotation_preparePopup(dict) {
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ key: '_preparePopup',
|
|
|
+ value: function _preparePopup(dict) {
|
|
|
if (!dict.has('C')) {
|
|
|
this.data.color = null;
|
|
|
}
|
|
|
this.data.hasPopup = dict.has('Popup');
|
|
|
this.data.title = (0, _util.stringToPDFString)(dict.get('T') || '');
|
|
|
this.data.contents = (0, _util.stringToPDFString)(dict.get('Contents') || '');
|
|
|
- },
|
|
|
- loadResources: function Annotation_loadResources(keys) {
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ key: 'loadResources',
|
|
|
+ value: function loadResources(keys) {
|
|
|
return this.appearance.dict.getAsync('Resources').then(function (resources) {
|
|
|
if (!resources) {
|
|
|
return;
|
|
@@ -248,8 +281,10 @@ var Annotation = function AnnotationClosure() {
|
|
|
return resources;
|
|
|
});
|
|
|
});
|
|
|
- },
|
|
|
- getOperatorList: function Annotation_getOperatorList(evaluator, task, renderForms) {
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ key: 'getOperatorList',
|
|
|
+ value: function getOperatorList(evaluator, task, renderForms) {
|
|
|
var _this = this;
|
|
|
|
|
|
if (!this.appearance) {
|
|
@@ -276,24 +311,48 @@ var Annotation = function AnnotationClosure() {
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
- };
|
|
|
+ }, {
|
|
|
+ key: 'viewable',
|
|
|
+ get: function get() {
|
|
|
+ if (this.flags === 0) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ return this._isViewable(this.flags);
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ key: 'printable',
|
|
|
+ get: function get() {
|
|
|
+ if (this.flags === 0) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return this._isPrintable(this.flags);
|
|
|
+ }
|
|
|
+ }]);
|
|
|
+
|
|
|
return Annotation;
|
|
|
}();
|
|
|
-var AnnotationBorderStyle = function AnnotationBorderStyleClosure() {
|
|
|
+
|
|
|
+var AnnotationBorderStyle = function () {
|
|
|
function AnnotationBorderStyle() {
|
|
|
+ _classCallCheck(this, AnnotationBorderStyle);
|
|
|
+
|
|
|
this.width = 1;
|
|
|
this.style = _util.AnnotationBorderStyleType.SOLID;
|
|
|
this.dashArray = [3];
|
|
|
this.horizontalCornerRadius = 0;
|
|
|
this.verticalCornerRadius = 0;
|
|
|
}
|
|
|
- AnnotationBorderStyle.prototype = {
|
|
|
- setWidth: function AnnotationBorderStyle_setWidth(width) {
|
|
|
+
|
|
|
+ _createClass(AnnotationBorderStyle, [{
|
|
|
+ key: 'setWidth',
|
|
|
+ value: function setWidth(width) {
|
|
|
if (width === (width | 0)) {
|
|
|
this.width = width;
|
|
|
}
|
|
|
- },
|
|
|
- setStyle: function AnnotationBorderStyle_setStyle(style) {
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ key: 'setStyle',
|
|
|
+ value: function setStyle(style) {
|
|
|
if (!style) {
|
|
|
return;
|
|
|
}
|
|
@@ -316,8 +375,10 @@ var AnnotationBorderStyle = function AnnotationBorderStyleClosure() {
|
|
|
default:
|
|
|
break;
|
|
|
}
|
|
|
- },
|
|
|
- setDashArray: function AnnotationBorderStyle_setDashArray(dashArray) {
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ key: 'setDashArray',
|
|
|
+ value: function setDashArray(dashArray) {
|
|
|
if ((0, _util.isArray)(dashArray) && dashArray.length > 0) {
|
|
|
var isValid = true;
|
|
|
var allZeros = true;
|
|
@@ -339,44 +400,58 @@ var AnnotationBorderStyle = function AnnotationBorderStyleClosure() {
|
|
|
} else if (dashArray) {
|
|
|
this.width = 0;
|
|
|
}
|
|
|
- },
|
|
|
- setHorizontalCornerRadius: function AnnotationBorderStyle_setHorizontalCornerRadius(radius) {
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ key: 'setHorizontalCornerRadius',
|
|
|
+ value: function setHorizontalCornerRadius(radius) {
|
|
|
if (radius === (radius | 0)) {
|
|
|
this.horizontalCornerRadius = radius;
|
|
|
}
|
|
|
- },
|
|
|
- setVerticalCornerRadius: function AnnotationBorderStyle_setVerticalCornerRadius(radius) {
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ key: 'setVerticalCornerRadius',
|
|
|
+ value: function setVerticalCornerRadius(radius) {
|
|
|
if (radius === (radius | 0)) {
|
|
|
this.verticalCornerRadius = radius;
|
|
|
}
|
|
|
}
|
|
|
- };
|
|
|
+ }]);
|
|
|
+
|
|
|
return AnnotationBorderStyle;
|
|
|
}();
|
|
|
-var WidgetAnnotation = function WidgetAnnotationClosure() {
|
|
|
+
|
|
|
+var WidgetAnnotation = function (_Annotation) {
|
|
|
+ _inherits(WidgetAnnotation, _Annotation);
|
|
|
+
|
|
|
function WidgetAnnotation(params) {
|
|
|
- Annotation.call(this, params);
|
|
|
+ _classCallCheck(this, WidgetAnnotation);
|
|
|
+
|
|
|
+ var _this2 = _possibleConstructorReturn(this, (WidgetAnnotation.__proto__ || Object.getPrototypeOf(WidgetAnnotation)).call(this, params));
|
|
|
+
|
|
|
var dict = params.dict;
|
|
|
- var data = this.data;
|
|
|
+ var data = _this2.data;
|
|
|
data.annotationType = _util.AnnotationType.WIDGET;
|
|
|
- data.fieldName = this._constructFieldName(dict);
|
|
|
+ data.fieldName = _this2._constructFieldName(dict);
|
|
|
data.fieldValue = _util.Util.getInheritableProperty(dict, 'V', true);
|
|
|
data.alternativeText = (0, _util.stringToPDFString)(dict.get('TU') || '');
|
|
|
data.defaultAppearance = _util.Util.getInheritableProperty(dict, 'DA') || '';
|
|
|
var fieldType = _util.Util.getInheritableProperty(dict, 'FT');
|
|
|
data.fieldType = (0, _primitives.isName)(fieldType) ? fieldType.name : null;
|
|
|
- this.fieldResources = _util.Util.getInheritableProperty(dict, 'DR') || _primitives.Dict.empty;
|
|
|
+ _this2.fieldResources = _util.Util.getInheritableProperty(dict, 'DR') || _primitives.Dict.empty;
|
|
|
data.fieldFlags = _util.Util.getInheritableProperty(dict, 'Ff');
|
|
|
if (!(0, _util.isInt)(data.fieldFlags) || data.fieldFlags < 0) {
|
|
|
data.fieldFlags = 0;
|
|
|
}
|
|
|
- data.readOnly = this.hasFieldFlag(_util.AnnotationFieldFlag.READONLY);
|
|
|
+ data.readOnly = _this2.hasFieldFlag(_util.AnnotationFieldFlag.READONLY);
|
|
|
if (data.fieldType === 'Sig') {
|
|
|
- this.setFlags(_util.AnnotationFlag.HIDDEN);
|
|
|
+ _this2.setFlags(_util.AnnotationFlag.HIDDEN);
|
|
|
}
|
|
|
+ return _this2;
|
|
|
}
|
|
|
- _util.Util.inherit(WidgetAnnotation, Annotation, {
|
|
|
- _constructFieldName: function WidgetAnnotation_constructFieldName(dict) {
|
|
|
+
|
|
|
+ _createClass(WidgetAnnotation, [{
|
|
|
+ key: '_constructFieldName',
|
|
|
+ value: function _constructFieldName(dict) {
|
|
|
if (!dict.has('T') && !dict.has('Parent')) {
|
|
|
(0, _util.warn)('Unknown field name, falling back to empty field name.');
|
|
|
return '';
|
|
@@ -399,39 +474,56 @@ var WidgetAnnotation = function WidgetAnnotationClosure() {
|
|
|
}
|
|
|
}
|
|
|
return fieldName.join('.');
|
|
|
- },
|
|
|
- hasFieldFlag: function WidgetAnnotation_hasFieldFlag(flag) {
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ key: 'hasFieldFlag',
|
|
|
+ value: function hasFieldFlag(flag) {
|
|
|
return !!(this.data.fieldFlags & flag);
|
|
|
}
|
|
|
- });
|
|
|
+ }, {
|
|
|
+ key: 'getOperatorList',
|
|
|
+ value: function getOperatorList(evaluator, task, renderForms) {
|
|
|
+ if (renderForms) {
|
|
|
+ return Promise.resolve(new _evaluator.OperatorList());
|
|
|
+ }
|
|
|
+ return _get(WidgetAnnotation.prototype.__proto__ || Object.getPrototypeOf(WidgetAnnotation.prototype), 'getOperatorList', this).call(this, evaluator, task, renderForms);
|
|
|
+ }
|
|
|
+ }]);
|
|
|
+
|
|
|
return WidgetAnnotation;
|
|
|
-}();
|
|
|
-var TextWidgetAnnotation = function TextWidgetAnnotationClosure() {
|
|
|
+}(Annotation);
|
|
|
+
|
|
|
+var TextWidgetAnnotation = function (_WidgetAnnotation) {
|
|
|
+ _inherits(TextWidgetAnnotation, _WidgetAnnotation);
|
|
|
+
|
|
|
function TextWidgetAnnotation(params) {
|
|
|
- WidgetAnnotation.call(this, params);
|
|
|
- this.data.fieldValue = (0, _util.stringToPDFString)(this.data.fieldValue || '');
|
|
|
+ _classCallCheck(this, TextWidgetAnnotation);
|
|
|
+
|
|
|
+ var _this3 = _possibleConstructorReturn(this, (TextWidgetAnnotation.__proto__ || Object.getPrototypeOf(TextWidgetAnnotation)).call(this, params));
|
|
|
+
|
|
|
+ _this3.data.fieldValue = (0, _util.stringToPDFString)(_this3.data.fieldValue || '');
|
|
|
var alignment = _util.Util.getInheritableProperty(params.dict, 'Q');
|
|
|
if (!(0, _util.isInt)(alignment) || alignment < 0 || alignment > 2) {
|
|
|
alignment = null;
|
|
|
}
|
|
|
- this.data.textAlignment = alignment;
|
|
|
+ _this3.data.textAlignment = alignment;
|
|
|
var maximumLength = _util.Util.getInheritableProperty(params.dict, 'MaxLen');
|
|
|
if (!(0, _util.isInt)(maximumLength) || maximumLength < 0) {
|
|
|
maximumLength = null;
|
|
|
}
|
|
|
- this.data.maxLen = maximumLength;
|
|
|
- this.data.multiLine = this.hasFieldFlag(_util.AnnotationFieldFlag.MULTILINE);
|
|
|
- this.data.comb = this.hasFieldFlag(_util.AnnotationFieldFlag.COMB) && !this.hasFieldFlag(_util.AnnotationFieldFlag.MULTILINE) && !this.hasFieldFlag(_util.AnnotationFieldFlag.PASSWORD) && !this.hasFieldFlag(_util.AnnotationFieldFlag.FILESELECT) && this.data.maxLen !== null;
|
|
|
+ _this3.data.maxLen = maximumLength;
|
|
|
+ _this3.data.multiLine = _this3.hasFieldFlag(_util.AnnotationFieldFlag.MULTILINE);
|
|
|
+ _this3.data.comb = _this3.hasFieldFlag(_util.AnnotationFieldFlag.COMB) && !_this3.hasFieldFlag(_util.AnnotationFieldFlag.MULTILINE) && !_this3.hasFieldFlag(_util.AnnotationFieldFlag.PASSWORD) && !_this3.hasFieldFlag(_util.AnnotationFieldFlag.FILESELECT) && _this3.data.maxLen !== null;
|
|
|
+ return _this3;
|
|
|
}
|
|
|
- _util.Util.inherit(TextWidgetAnnotation, WidgetAnnotation, {
|
|
|
- getOperatorList: function TextWidgetAnnotation_getOperatorList(evaluator, task, renderForms) {
|
|
|
- var operatorList = new _evaluator.OperatorList();
|
|
|
- if (renderForms) {
|
|
|
- return Promise.resolve(operatorList);
|
|
|
- }
|
|
|
- if (this.appearance) {
|
|
|
- return Annotation.prototype.getOperatorList.call(this, evaluator, task, renderForms);
|
|
|
+
|
|
|
+ _createClass(TextWidgetAnnotation, [{
|
|
|
+ key: 'getOperatorList',
|
|
|
+ value: function getOperatorList(evaluator, task, renderForms) {
|
|
|
+ if (renderForms || this.appearance) {
|
|
|
+ return _get(TextWidgetAnnotation.prototype.__proto__ || Object.getPrototypeOf(TextWidgetAnnotation.prototype), 'getOperatorList', this).call(this, evaluator, task, renderForms);
|
|
|
}
|
|
|
+ var operatorList = new _evaluator.OperatorList();
|
|
|
if (!this.data.defaultAppearance) {
|
|
|
return Promise.resolve(operatorList);
|
|
|
}
|
|
@@ -445,213 +537,273 @@ var TextWidgetAnnotation = function TextWidgetAnnotationClosure() {
|
|
|
return operatorList;
|
|
|
});
|
|
|
}
|
|
|
- });
|
|
|
+ }]);
|
|
|
+
|
|
|
return TextWidgetAnnotation;
|
|
|
-}();
|
|
|
-var ButtonWidgetAnnotation = function ButtonWidgetAnnotationClosure() {
|
|
|
+}(WidgetAnnotation);
|
|
|
+
|
|
|
+var ButtonWidgetAnnotation = function (_WidgetAnnotation2) {
|
|
|
+ _inherits(ButtonWidgetAnnotation, _WidgetAnnotation2);
|
|
|
+
|
|
|
function ButtonWidgetAnnotation(params) {
|
|
|
- WidgetAnnotation.call(this, params);
|
|
|
- this.data.checkBox = !this.hasFieldFlag(_util.AnnotationFieldFlag.RADIO) && !this.hasFieldFlag(_util.AnnotationFieldFlag.PUSHBUTTON);
|
|
|
- if (this.data.checkBox) {
|
|
|
- if (!(0, _primitives.isName)(this.data.fieldValue)) {
|
|
|
- return;
|
|
|
+ _classCallCheck(this, ButtonWidgetAnnotation);
|
|
|
+
|
|
|
+ var _this4 = _possibleConstructorReturn(this, (ButtonWidgetAnnotation.__proto__ || Object.getPrototypeOf(ButtonWidgetAnnotation)).call(this, params));
|
|
|
+
|
|
|
+ _this4.data.checkBox = !_this4.hasFieldFlag(_util.AnnotationFieldFlag.RADIO) && !_this4.hasFieldFlag(_util.AnnotationFieldFlag.PUSHBUTTON);
|
|
|
+ if (_this4.data.checkBox) {
|
|
|
+ if (!(0, _primitives.isName)(_this4.data.fieldValue)) {
|
|
|
+ return _possibleConstructorReturn(_this4);
|
|
|
}
|
|
|
- this.data.fieldValue = this.data.fieldValue.name;
|
|
|
+ _this4.data.fieldValue = _this4.data.fieldValue.name;
|
|
|
}
|
|
|
- this.data.radioButton = this.hasFieldFlag(_util.AnnotationFieldFlag.RADIO) && !this.hasFieldFlag(_util.AnnotationFieldFlag.PUSHBUTTON);
|
|
|
- if (this.data.radioButton) {
|
|
|
- this.data.fieldValue = this.data.buttonValue = null;
|
|
|
+ _this4.data.radioButton = _this4.hasFieldFlag(_util.AnnotationFieldFlag.RADIO) && !_this4.hasFieldFlag(_util.AnnotationFieldFlag.PUSHBUTTON);
|
|
|
+ if (_this4.data.radioButton) {
|
|
|
+ _this4.data.fieldValue = _this4.data.buttonValue = null;
|
|
|
var fieldParent = params.dict.get('Parent');
|
|
|
if ((0, _primitives.isDict)(fieldParent) && fieldParent.has('V')) {
|
|
|
var fieldParentValue = fieldParent.get('V');
|
|
|
if ((0, _primitives.isName)(fieldParentValue)) {
|
|
|
- this.data.fieldValue = fieldParentValue.name;
|
|
|
+ _this4.data.fieldValue = fieldParentValue.name;
|
|
|
}
|
|
|
}
|
|
|
var appearanceStates = params.dict.get('AP');
|
|
|
if (!(0, _primitives.isDict)(appearanceStates)) {
|
|
|
- return;
|
|
|
+ return _possibleConstructorReturn(_this4);
|
|
|
}
|
|
|
var normalAppearanceState = appearanceStates.get('N');
|
|
|
if (!(0, _primitives.isDict)(normalAppearanceState)) {
|
|
|
- return;
|
|
|
+ return _possibleConstructorReturn(_this4);
|
|
|
}
|
|
|
var keys = normalAppearanceState.getKeys();
|
|
|
for (var i = 0, ii = keys.length; i < ii; i++) {
|
|
|
if (keys[i] !== 'Off') {
|
|
|
- this.data.buttonValue = keys[i];
|
|
|
+ _this4.data.buttonValue = keys[i];
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ return _this4;
|
|
|
}
|
|
|
- _util.Util.inherit(ButtonWidgetAnnotation, WidgetAnnotation, {
|
|
|
- getOperatorList: function ButtonWidgetAnnotation_getOperatorList(evaluator, task, renderForms) {
|
|
|
- var operatorList = new _evaluator.OperatorList();
|
|
|
- if (renderForms) {
|
|
|
- return Promise.resolve(operatorList);
|
|
|
- }
|
|
|
- if (this.appearance) {
|
|
|
- return Annotation.prototype.getOperatorList.call(this, evaluator, task, renderForms);
|
|
|
- }
|
|
|
- return Promise.resolve(operatorList);
|
|
|
- }
|
|
|
- });
|
|
|
+
|
|
|
return ButtonWidgetAnnotation;
|
|
|
-}();
|
|
|
-var ChoiceWidgetAnnotation = function ChoiceWidgetAnnotationClosure() {
|
|
|
+}(WidgetAnnotation);
|
|
|
+
|
|
|
+var ChoiceWidgetAnnotation = function (_WidgetAnnotation3) {
|
|
|
+ _inherits(ChoiceWidgetAnnotation, _WidgetAnnotation3);
|
|
|
+
|
|
|
function ChoiceWidgetAnnotation(params) {
|
|
|
- WidgetAnnotation.call(this, params);
|
|
|
- this.data.options = [];
|
|
|
+ _classCallCheck(this, ChoiceWidgetAnnotation);
|
|
|
+
|
|
|
+ var _this5 = _possibleConstructorReturn(this, (ChoiceWidgetAnnotation.__proto__ || Object.getPrototypeOf(ChoiceWidgetAnnotation)).call(this, params));
|
|
|
+
|
|
|
+ _this5.data.options = [];
|
|
|
var options = _util.Util.getInheritableProperty(params.dict, 'Opt');
|
|
|
if ((0, _util.isArray)(options)) {
|
|
|
var xref = params.xref;
|
|
|
for (var i = 0, ii = options.length; i < ii; i++) {
|
|
|
var option = xref.fetchIfRef(options[i]);
|
|
|
var isOptionArray = (0, _util.isArray)(option);
|
|
|
- this.data.options[i] = {
|
|
|
+ _this5.data.options[i] = {
|
|
|
exportValue: isOptionArray ? xref.fetchIfRef(option[0]) : option,
|
|
|
displayValue: isOptionArray ? xref.fetchIfRef(option[1]) : option
|
|
|
};
|
|
|
}
|
|
|
}
|
|
|
- if (!(0, _util.isArray)(this.data.fieldValue)) {
|
|
|
- this.data.fieldValue = [this.data.fieldValue];
|
|
|
+ if (!(0, _util.isArray)(_this5.data.fieldValue)) {
|
|
|
+ _this5.data.fieldValue = [_this5.data.fieldValue];
|
|
|
}
|
|
|
- this.data.combo = this.hasFieldFlag(_util.AnnotationFieldFlag.COMBO);
|
|
|
- this.data.multiSelect = this.hasFieldFlag(_util.AnnotationFieldFlag.MULTISELECT);
|
|
|
+ _this5.data.combo = _this5.hasFieldFlag(_util.AnnotationFieldFlag.COMBO);
|
|
|
+ _this5.data.multiSelect = _this5.hasFieldFlag(_util.AnnotationFieldFlag.MULTISELECT);
|
|
|
+ return _this5;
|
|
|
}
|
|
|
- _util.Util.inherit(ChoiceWidgetAnnotation, WidgetAnnotation, {
|
|
|
- getOperatorList: function ChoiceWidgetAnnotation_getOperatorList(evaluator, task, renderForms) {
|
|
|
- var operatorList = new _evaluator.OperatorList();
|
|
|
- if (renderForms) {
|
|
|
- return Promise.resolve(operatorList);
|
|
|
- }
|
|
|
- return Annotation.prototype.getOperatorList.call(this, evaluator, task, renderForms);
|
|
|
- }
|
|
|
- });
|
|
|
+
|
|
|
return ChoiceWidgetAnnotation;
|
|
|
-}();
|
|
|
-var TextAnnotation = function TextAnnotationClosure() {
|
|
|
- var DEFAULT_ICON_SIZE = 22;
|
|
|
+}(WidgetAnnotation);
|
|
|
+
|
|
|
+var TextAnnotation = function (_Annotation2) {
|
|
|
+ _inherits(TextAnnotation, _Annotation2);
|
|
|
+
|
|
|
function TextAnnotation(parameters) {
|
|
|
- Annotation.call(this, parameters);
|
|
|
- this.data.annotationType = _util.AnnotationType.TEXT;
|
|
|
- if (this.data.hasAppearance) {
|
|
|
- this.data.name = 'NoIcon';
|
|
|
+ _classCallCheck(this, TextAnnotation);
|
|
|
+
|
|
|
+ var DEFAULT_ICON_SIZE = 22;
|
|
|
+
|
|
|
+ var _this6 = _possibleConstructorReturn(this, (TextAnnotation.__proto__ || Object.getPrototypeOf(TextAnnotation)).call(this, parameters));
|
|
|
+
|
|
|
+ _this6.data.annotationType = _util.AnnotationType.TEXT;
|
|
|
+ if (_this6.data.hasAppearance) {
|
|
|
+ _this6.data.name = 'NoIcon';
|
|
|
} else {
|
|
|
- this.data.rect[1] = this.data.rect[3] - DEFAULT_ICON_SIZE;
|
|
|
- this.data.rect[2] = this.data.rect[0] + DEFAULT_ICON_SIZE;
|
|
|
- this.data.name = parameters.dict.has('Name') ? parameters.dict.get('Name').name : 'Note';
|
|
|
+ _this6.data.rect[1] = _this6.data.rect[3] - DEFAULT_ICON_SIZE;
|
|
|
+ _this6.data.rect[2] = _this6.data.rect[0] + DEFAULT_ICON_SIZE;
|
|
|
+ _this6.data.name = parameters.dict.has('Name') ? parameters.dict.get('Name').name : 'Note';
|
|
|
}
|
|
|
- this._preparePopup(parameters.dict);
|
|
|
+ _this6._preparePopup(parameters.dict);
|
|
|
+ return _this6;
|
|
|
}
|
|
|
- _util.Util.inherit(TextAnnotation, Annotation, {});
|
|
|
+
|
|
|
return TextAnnotation;
|
|
|
-}();
|
|
|
-var LinkAnnotation = function LinkAnnotationClosure() {
|
|
|
+}(Annotation);
|
|
|
+
|
|
|
+var LinkAnnotation = function (_Annotation3) {
|
|
|
+ _inherits(LinkAnnotation, _Annotation3);
|
|
|
+
|
|
|
function LinkAnnotation(params) {
|
|
|
- Annotation.call(this, params);
|
|
|
- var data = this.data;
|
|
|
- data.annotationType = _util.AnnotationType.LINK;
|
|
|
+ _classCallCheck(this, LinkAnnotation);
|
|
|
+
|
|
|
+ var _this7 = _possibleConstructorReturn(this, (LinkAnnotation.__proto__ || Object.getPrototypeOf(LinkAnnotation)).call(this, params));
|
|
|
+
|
|
|
+ _this7.data.annotationType = _util.AnnotationType.LINK;
|
|
|
_obj.Catalog.parseDestDictionary({
|
|
|
destDict: params.dict,
|
|
|
- resultObj: data,
|
|
|
+ resultObj: _this7.data,
|
|
|
docBaseUrl: params.pdfManager.docBaseUrl
|
|
|
});
|
|
|
+ return _this7;
|
|
|
}
|
|
|
- _util.Util.inherit(LinkAnnotation, Annotation, {});
|
|
|
+
|
|
|
return LinkAnnotation;
|
|
|
-}();
|
|
|
-var PopupAnnotation = function PopupAnnotationClosure() {
|
|
|
+}(Annotation);
|
|
|
+
|
|
|
+var PopupAnnotation = function (_Annotation4) {
|
|
|
+ _inherits(PopupAnnotation, _Annotation4);
|
|
|
+
|
|
|
function PopupAnnotation(parameters) {
|
|
|
- Annotation.call(this, parameters);
|
|
|
- this.data.annotationType = _util.AnnotationType.POPUP;
|
|
|
+ _classCallCheck(this, PopupAnnotation);
|
|
|
+
|
|
|
+ var _this8 = _possibleConstructorReturn(this, (PopupAnnotation.__proto__ || Object.getPrototypeOf(PopupAnnotation)).call(this, parameters));
|
|
|
+
|
|
|
+ _this8.data.annotationType = _util.AnnotationType.POPUP;
|
|
|
var dict = parameters.dict;
|
|
|
var parentItem = dict.get('Parent');
|
|
|
if (!parentItem) {
|
|
|
(0, _util.warn)('Popup annotation has a missing or invalid parent annotation.');
|
|
|
- return;
|
|
|
+ return _possibleConstructorReturn(_this8);
|
|
|
}
|
|
|
var parentSubtype = parentItem.get('Subtype');
|
|
|
- this.data.parentType = (0, _primitives.isName)(parentSubtype) ? parentSubtype.name : null;
|
|
|
- this.data.parentId = dict.getRaw('Parent').toString();
|
|
|
- this.data.title = (0, _util.stringToPDFString)(parentItem.get('T') || '');
|
|
|
- this.data.contents = (0, _util.stringToPDFString)(parentItem.get('Contents') || '');
|
|
|
+ _this8.data.parentType = (0, _primitives.isName)(parentSubtype) ? parentSubtype.name : null;
|
|
|
+ _this8.data.parentId = dict.getRaw('Parent').toString();
|
|
|
+ _this8.data.title = (0, _util.stringToPDFString)(parentItem.get('T') || '');
|
|
|
+ _this8.data.contents = (0, _util.stringToPDFString)(parentItem.get('Contents') || '');
|
|
|
if (!parentItem.has('C')) {
|
|
|
- this.data.color = null;
|
|
|
+ _this8.data.color = null;
|
|
|
} else {
|
|
|
- this.setColor(parentItem.getArray('C'));
|
|
|
- this.data.color = this.color;
|
|
|
+ _this8.setColor(parentItem.getArray('C'));
|
|
|
+ _this8.data.color = _this8.color;
|
|
|
}
|
|
|
- if (!this.viewable) {
|
|
|
+ if (!_this8.viewable) {
|
|
|
var parentFlags = parentItem.get('F');
|
|
|
- if (this._isViewable(parentFlags)) {
|
|
|
- this.setFlags(parentFlags);
|
|
|
+ if (_this8._isViewable(parentFlags)) {
|
|
|
+ _this8.setFlags(parentFlags);
|
|
|
}
|
|
|
}
|
|
|
+ return _this8;
|
|
|
}
|
|
|
- _util.Util.inherit(PopupAnnotation, Annotation, {});
|
|
|
+
|
|
|
return PopupAnnotation;
|
|
|
-}();
|
|
|
-var LineAnnotation = function LineAnnotationClosure() {
|
|
|
+}(Annotation);
|
|
|
+
|
|
|
+var LineAnnotation = function (_Annotation5) {
|
|
|
+ _inherits(LineAnnotation, _Annotation5);
|
|
|
+
|
|
|
function LineAnnotation(parameters) {
|
|
|
- Annotation.call(this, parameters);
|
|
|
- this.data.annotationType = _util.AnnotationType.LINE;
|
|
|
+ _classCallCheck(this, LineAnnotation);
|
|
|
+
|
|
|
+ var _this9 = _possibleConstructorReturn(this, (LineAnnotation.__proto__ || Object.getPrototypeOf(LineAnnotation)).call(this, parameters));
|
|
|
+
|
|
|
+ _this9.data.annotationType = _util.AnnotationType.LINE;
|
|
|
var dict = parameters.dict;
|
|
|
- this.data.lineCoordinates = _util.Util.normalizeRect(dict.getArray('L'));
|
|
|
- this._preparePopup(dict);
|
|
|
+ _this9.data.lineCoordinates = _util.Util.normalizeRect(dict.getArray('L'));
|
|
|
+ _this9._preparePopup(dict);
|
|
|
+ return _this9;
|
|
|
}
|
|
|
- _util.Util.inherit(LineAnnotation, Annotation, {});
|
|
|
+
|
|
|
return LineAnnotation;
|
|
|
-}();
|
|
|
-var HighlightAnnotation = function HighlightAnnotationClosure() {
|
|
|
+}(Annotation);
|
|
|
+
|
|
|
+var HighlightAnnotation = function (_Annotation6) {
|
|
|
+ _inherits(HighlightAnnotation, _Annotation6);
|
|
|
+
|
|
|
function HighlightAnnotation(parameters) {
|
|
|
- Annotation.call(this, parameters);
|
|
|
- this.data.annotationType = _util.AnnotationType.HIGHLIGHT;
|
|
|
- this._preparePopup(parameters.dict);
|
|
|
+ _classCallCheck(this, HighlightAnnotation);
|
|
|
+
|
|
|
+ var _this10 = _possibleConstructorReturn(this, (HighlightAnnotation.__proto__ || Object.getPrototypeOf(HighlightAnnotation)).call(this, parameters));
|
|
|
+
|
|
|
+ _this10.data.annotationType = _util.AnnotationType.HIGHLIGHT;
|
|
|
+ _this10._preparePopup(parameters.dict);
|
|
|
+ return _this10;
|
|
|
}
|
|
|
- _util.Util.inherit(HighlightAnnotation, Annotation, {});
|
|
|
+
|
|
|
return HighlightAnnotation;
|
|
|
-}();
|
|
|
-var UnderlineAnnotation = function UnderlineAnnotationClosure() {
|
|
|
+}(Annotation);
|
|
|
+
|
|
|
+var UnderlineAnnotation = function (_Annotation7) {
|
|
|
+ _inherits(UnderlineAnnotation, _Annotation7);
|
|
|
+
|
|
|
function UnderlineAnnotation(parameters) {
|
|
|
- Annotation.call(this, parameters);
|
|
|
- this.data.annotationType = _util.AnnotationType.UNDERLINE;
|
|
|
- this._preparePopup(parameters.dict);
|
|
|
+ _classCallCheck(this, UnderlineAnnotation);
|
|
|
+
|
|
|
+ var _this11 = _possibleConstructorReturn(this, (UnderlineAnnotation.__proto__ || Object.getPrototypeOf(UnderlineAnnotation)).call(this, parameters));
|
|
|
+
|
|
|
+ _this11.data.annotationType = _util.AnnotationType.UNDERLINE;
|
|
|
+ _this11._preparePopup(parameters.dict);
|
|
|
+ return _this11;
|
|
|
}
|
|
|
- _util.Util.inherit(UnderlineAnnotation, Annotation, {});
|
|
|
+
|
|
|
return UnderlineAnnotation;
|
|
|
-}();
|
|
|
-var SquigglyAnnotation = function SquigglyAnnotationClosure() {
|
|
|
+}(Annotation);
|
|
|
+
|
|
|
+var SquigglyAnnotation = function (_Annotation8) {
|
|
|
+ _inherits(SquigglyAnnotation, _Annotation8);
|
|
|
+
|
|
|
function SquigglyAnnotation(parameters) {
|
|
|
- Annotation.call(this, parameters);
|
|
|
- this.data.annotationType = _util.AnnotationType.SQUIGGLY;
|
|
|
- this._preparePopup(parameters.dict);
|
|
|
+ _classCallCheck(this, SquigglyAnnotation);
|
|
|
+
|
|
|
+ var _this12 = _possibleConstructorReturn(this, (SquigglyAnnotation.__proto__ || Object.getPrototypeOf(SquigglyAnnotation)).call(this, parameters));
|
|
|
+
|
|
|
+ _this12.data.annotationType = _util.AnnotationType.SQUIGGLY;
|
|
|
+ _this12._preparePopup(parameters.dict);
|
|
|
+ return _this12;
|
|
|
}
|
|
|
- _util.Util.inherit(SquigglyAnnotation, Annotation, {});
|
|
|
+
|
|
|
return SquigglyAnnotation;
|
|
|
-}();
|
|
|
-var StrikeOutAnnotation = function StrikeOutAnnotationClosure() {
|
|
|
+}(Annotation);
|
|
|
+
|
|
|
+var StrikeOutAnnotation = function (_Annotation9) {
|
|
|
+ _inherits(StrikeOutAnnotation, _Annotation9);
|
|
|
+
|
|
|
function StrikeOutAnnotation(parameters) {
|
|
|
- Annotation.call(this, parameters);
|
|
|
- this.data.annotationType = _util.AnnotationType.STRIKEOUT;
|
|
|
- this._preparePopup(parameters.dict);
|
|
|
+ _classCallCheck(this, StrikeOutAnnotation);
|
|
|
+
|
|
|
+ var _this13 = _possibleConstructorReturn(this, (StrikeOutAnnotation.__proto__ || Object.getPrototypeOf(StrikeOutAnnotation)).call(this, parameters));
|
|
|
+
|
|
|
+ _this13.data.annotationType = _util.AnnotationType.STRIKEOUT;
|
|
|
+ _this13._preparePopup(parameters.dict);
|
|
|
+ return _this13;
|
|
|
}
|
|
|
- _util.Util.inherit(StrikeOutAnnotation, Annotation, {});
|
|
|
+
|
|
|
return StrikeOutAnnotation;
|
|
|
-}();
|
|
|
-var FileAttachmentAnnotation = function FileAttachmentAnnotationClosure() {
|
|
|
+}(Annotation);
|
|
|
+
|
|
|
+var FileAttachmentAnnotation = function (_Annotation10) {
|
|
|
+ _inherits(FileAttachmentAnnotation, _Annotation10);
|
|
|
+
|
|
|
function FileAttachmentAnnotation(parameters) {
|
|
|
- Annotation.call(this, parameters);
|
|
|
+ _classCallCheck(this, FileAttachmentAnnotation);
|
|
|
+
|
|
|
+ var _this14 = _possibleConstructorReturn(this, (FileAttachmentAnnotation.__proto__ || Object.getPrototypeOf(FileAttachmentAnnotation)).call(this, parameters));
|
|
|
+
|
|
|
var file = new _obj.FileSpec(parameters.dict.get('FS'), parameters.xref);
|
|
|
- this.data.annotationType = _util.AnnotationType.FILEATTACHMENT;
|
|
|
- this.data.file = file.serializable;
|
|
|
- this._preparePopup(parameters.dict);
|
|
|
+ _this14.data.annotationType = _util.AnnotationType.FILEATTACHMENT;
|
|
|
+ _this14.data.file = file.serializable;
|
|
|
+ _this14._preparePopup(parameters.dict);
|
|
|
+ return _this14;
|
|
|
}
|
|
|
- _util.Util.inherit(FileAttachmentAnnotation, Annotation, {});
|
|
|
+
|
|
|
return FileAttachmentAnnotation;
|
|
|
-}();
|
|
|
+}(Annotation);
|
|
|
+
|
|
|
exports.Annotation = Annotation;
|
|
|
exports.AnnotationBorderStyle = AnnotationBorderStyle;
|
|
|
exports.AnnotationFactory = AnnotationFactory;
|