all files / pdfviewer/drawing/ pdf-annotation.js

91.96% Statements 183/199
76.74% Branches 33/43
54.17% Functions 13/24
91.71% Lines 177/193
5 statements, 2 functions, 11 branches Ignored     
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499    77× 77× 77×       1025× 1025× 1025× 1025×                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
/* istanbul ignore next */ 
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
/* istanbul ignore next */ 
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    Iif (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) Eif (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
define(["require", "exports", "@syncfusion/ej2-base", "@syncfusion/ej2-drawings", "@syncfusion/ej2-drawings"], function (require, exports, ej2_base_1, ej2_drawings_1, ej2_drawings_2) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var PdfBounds = (function (_super) {
        __extends(PdfBounds, _super);
        function PdfBounds() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        __decorate([
            ej2_base_1.Property(0)
        ], PdfBounds.prototype, "x", void 0);
        __decorate([
            ej2_base_1.Property(0)
        ], PdfBounds.prototype, "y", void 0);
        __decorate([
            ej2_base_1.Property(0)
        ], PdfBounds.prototype, "width", void 0);
        __decorate([
            ej2_base_1.Property(0)
        ], PdfBounds.prototype, "height", void 0);
        __decorate([
            ej2_base_1.Property(0)
        ], PdfBounds.prototype, "left", void 0);
        __decorate([
            ej2_base_1.Property(0)
        ], PdfBounds.prototype, "top", void 0);
        __decorate([
            ej2_base_1.Property(0)
        ], PdfBounds.prototype, "right", void 0);
        __decorate([
            ej2_base_1.Property(0)
        ], PdfBounds.prototype, "bottom", void 0);
        __decorate([
            ej2_base_1.Complex({ x: 0, y: 0 }, ej2_drawings_1.Point)
        ], PdfBounds.prototype, "location", void 0);
        __decorate([
            ej2_base_1.Complex(new ej2_drawings_2.Size(0, 0), ej2_drawings_2.Size)
        ], PdfBounds.prototype, "size", void 0);
        return PdfBounds;
    }(ej2_base_1.ChildProperty));
    exports.PdfBounds = PdfBounds;
    var PdfFont = (function (_super) {
        __extends(PdfFont, _super);
        function PdfFont() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        __decorate([
            ej2_base_1.Property(false)
        ], PdfFont.prototype, "isBold", void 0);
        __decorate([
            ej2_base_1.Property(false)
        ], PdfFont.prototype, "isItalic", void 0);
        __decorate([
            ej2_base_1.Property(false)
        ], PdfFont.prototype, "isUnderline", void 0);
        __decorate([
            ej2_base_1.Property(false)
        ], PdfFont.prototype, "isStrikeout", void 0);
        return PdfFont;
    }(ej2_base_1.ChildProperty));
    exports.PdfFont = PdfFont;
    var PdfAnnotationBase = (function (_super) {
        __extends(PdfAnnotationBase, _super);
        function PdfAnnotationBase(parent, propName, defaultValue, isArray) {
            return _super.call(this, parent, propName, defaultValue, isArray) || this;
        }
        __decorate([
            ej2_base_1.Property('')
        ], PdfAnnotationBase.prototype, "id", void 0);
        __decorate([
            ej2_base_1.Property('Rectangle')
        ], PdfAnnotationBase.prototype, "shapeAnnotationType", void 0);
        __decorate([
            ej2_base_1.Property(null)
        ], PdfAnnotationBase.prototype, "formFieldAnnotationType", void 0);
        __decorate([
            ej2_base_1.Property('')
        ], PdfAnnotationBase.prototype, "measureType", void 0);
        __decorate([
            ej2_base_1.Property('')
        ], PdfAnnotationBase.prototype, "author", void 0);
        __decorate([
            ej2_base_1.Property('')
        ], PdfAnnotationBase.prototype, "overlayText", void 0);
        __decorate([
            ej2_base_1.Property('')
        ], PdfAnnotationBase.prototype, "modifiedDate", void 0);
        __decorate([
            ej2_base_1.Property('')
        ], PdfAnnotationBase.prototype, "subject", void 0);
        __decorate([
            ej2_base_1.Property('')
        ], PdfAnnotationBase.prototype, "notes", void 0);
        __decorate([
            ej2_base_1.Property(false)
        ], PdfAnnotationBase.prototype, "isCommentLock", void 0);
        __decorate([
            ej2_base_1.Property('black')
        ], PdfAnnotationBase.prototype, "strokeColor", void 0);
        __decorate([
            ej2_base_1.Property('#ffffff00')
        ], PdfAnnotationBase.prototype, "fillColor", void 0);
        __decorate([
            ej2_base_1.Property(false)
        ], PdfAnnotationBase.prototype, "isRepeat", void 0);
        __decorate([
            ej2_base_1.Property(false)
        ], PdfAnnotationBase.prototype, "useOverlayText", void 0);
        __decorate([
            ej2_base_1.Property(1)
        ], PdfAnnotationBase.prototype, "markerOpacity", void 0);
        __decorate([
            ej2_base_1.Property('rgba(255, 0, 0, 1)')
        ], PdfAnnotationBase.prototype, "markerBorderColor", void 0);
        __decorate([
            ej2_base_1.Property('rgba(0, 0, 0, 1)')
        ], PdfAnnotationBase.prototype, "originalFillColor", void 0);
        __decorate([
            ej2_base_1.Property('rgba(255, 255, 255, 1)')
        ], PdfAnnotationBase.prototype, "markerFillColor", void 0);
        __decorate([
            ej2_base_1.Property('#ffffff00')
        ], PdfAnnotationBase.prototype, "stampFillColor", void 0);
        __decorate([
            ej2_base_1.Property('black')
        ], PdfAnnotationBase.prototype, "stampStrokeColor", void 0);
        __decorate([
            ej2_base_1.Property('')
        ], PdfAnnotationBase.prototype, "data", void 0);
        __decorate([
            ej2_base_1.Property(1)
        ], PdfAnnotationBase.prototype, "opacity", void 0);
        __decorate([
            ej2_base_1.Property(1)
        ], PdfAnnotationBase.prototype, "thickness", void 0);
        __decorate([
            ej2_base_1.Property('')
        ], PdfAnnotationBase.prototype, "borderStyle", void 0);
        __decorate([
            ej2_base_1.Property('')
        ], PdfAnnotationBase.prototype, "borderDashArray", void 0);
        __decorate([
            ej2_base_1.Property(0)
        ], PdfAnnotationBase.prototype, "rotateAngle", void 0);
        __decorate([
            ej2_base_1.Property(false)
        ], PdfAnnotationBase.prototype, "isCloudShape", void 0);
        __decorate([
            ej2_base_1.Property(0)
        ], PdfAnnotationBase.prototype, "cloudIntensity", void 0);
        __decorate([
            ej2_base_1.Property(40)
        ], PdfAnnotationBase.prototype, "leaderHeight", void 0);
        __decorate([
            ej2_base_1.Property(null)
        ], PdfAnnotationBase.prototype, "lineHeadStart", void 0);
        __decorate([
            ej2_base_1.Property(null)
        ], PdfAnnotationBase.prototype, "lineHeadEnd", void 0);
        __decorate([
            ej2_base_1.Property([])
        ], PdfAnnotationBase.prototype, "vertexPoints", void 0);
        __decorate([
            ej2_base_1.Property(null)
        ], PdfAnnotationBase.prototype, "sourcePoint", void 0);
        __decorate([
            ej2_base_1.Property('None')
        ], PdfAnnotationBase.prototype, "sourceDecoraterShapes", void 0);
        __decorate([
            ej2_base_1.Property('None')
        ], PdfAnnotationBase.prototype, "taregetDecoraterShapes", void 0);
        __decorate([
            ej2_base_1.Property(null)
        ], PdfAnnotationBase.prototype, "targetPoint", void 0);
        __decorate([
            ej2_base_1.Property([])
        ], PdfAnnotationBase.prototype, "segments", void 0);
        __decorate([
            ej2_base_1.Complex({ x: 0, y: 0 }, PdfBounds)
        ], PdfAnnotationBase.prototype, "bounds", void 0);
        __decorate([
            ej2_base_1.Property(0)
        ], PdfAnnotationBase.prototype, "pageIndex", void 0);
        __decorate([
            ej2_base_1.Property(-1)
        ], PdfAnnotationBase.prototype, "zIndex", void 0);
        __decorate([
            ej2_base_1.Property(null)
        ], PdfAnnotationBase.prototype, "wrapper", void 0);
        __decorate([
            ej2_base_1.Property(false)
        ], PdfAnnotationBase.prototype, "isDynamicStamp", void 0);
        __decorate([
            ej2_base_1.Property('')
        ], PdfAnnotationBase.prototype, "dynamicText", void 0);
        __decorate([
            ej2_base_1.Property('')
        ], PdfAnnotationBase.prototype, "annotName", void 0);
        __decorate([
            ej2_base_1.Property({})
        ], PdfAnnotationBase.prototype, "review", void 0);
        __decorate([
            ej2_base_1.Property([])
        ], PdfAnnotationBase.prototype, "comments", void 0);
        __decorate([
            ej2_base_1.Property('#000')
        ], PdfAnnotationBase.prototype, "fontColor", void 0);
        __decorate([
            ej2_base_1.Property(16)
        ], PdfAnnotationBase.prototype, "fontSize", void 0);
        __decorate([
            ej2_base_1.Property('Helvetica')
        ], PdfAnnotationBase.prototype, "fontFamily", void 0);
        __decorate([
            ej2_base_1.Property('None')
        ], PdfAnnotationBase.prototype, "fontStyle", void 0);
        __decorate([
            ej2_base_1.Property(false)
        ], PdfAnnotationBase.prototype, "enableShapeLabel", void 0);
        __decorate([
            ej2_base_1.Property('label')
        ], PdfAnnotationBase.prototype, "labelContent", void 0);
        __decorate([
            ej2_base_1.Property('#ffffff00')
        ], PdfAnnotationBase.prototype, "labelFillColor", void 0);
        __decorate([
            ej2_base_1.Property(15)
        ], PdfAnnotationBase.prototype, "labelMaxLength", void 0);
        __decorate([
            ej2_base_1.Property('')
        ], PdfAnnotationBase.prototype, "template", void 0);
        __decorate([
            ej2_base_1.Property('')
        ], PdfAnnotationBase.prototype, "templateSize", void 0);
        __decorate([
            ej2_base_1.Property(1)
        ], PdfAnnotationBase.prototype, "labelOpacity", void 0);
        __decorate([
            ej2_base_1.Property('')
        ], PdfAnnotationBase.prototype, "annotationSelectorSettings", void 0);
        __decorate([
            ej2_base_1.Property('#ffffff00')
        ], PdfAnnotationBase.prototype, "labelBorderColor", void 0);
        __decorate([
            ej2_base_1.Property('left')
        ], PdfAnnotationBase.prototype, "textAlign", void 0);
        __decorate([
            ej2_base_1.Property('')
        ], PdfAnnotationBase.prototype, "signatureName", void 0);
        __decorate([
            ej2_base_1.Property(0)
        ], PdfAnnotationBase.prototype, "minHeight", void 0);
        __decorate([
            ej2_base_1.Property(0)
        ], PdfAnnotationBase.prototype, "minWidth", void 0);
        __decorate([
            ej2_base_1.Property(0)
        ], PdfAnnotationBase.prototype, "maxHeight", void 0);
        __decorate([
            ej2_base_1.Property(0)
        ], PdfAnnotationBase.prototype, "maxWidth", void 0);
        __decorate([
            ej2_base_1.Property(false)
        ], PdfAnnotationBase.prototype, "isLock", void 0);
        __decorate([
            ej2_base_1.Property('UI Drawn Annotation')
        ], PdfAnnotationBase.prototype, "annotationAddMode", void 0);
        __decorate([
            ej2_base_1.Property('')
        ], PdfAnnotationBase.prototype, "annotationSettings", void 0);
        __decorate([
            ej2_base_1.Property(16)
        ], PdfAnnotationBase.prototype, "previousFontSize", void 0);
        __decorate([
            ej2_base_1.Complex({ isBold: false, isItalic: false, isStrikeout: false, isUnderline: false }, PdfFont)
        ], PdfAnnotationBase.prototype, "font", void 0);
        __decorate([
            ej2_base_1.Complex({ x: 0, y: 0 }, PdfBounds)
        ], PdfAnnotationBase.prototype, "labelBounds", void 0);
        __decorate([
            ej2_base_1.Property(null)
        ], PdfAnnotationBase.prototype, "customData", void 0);
        __decorate([
            ej2_base_1.Property(['None'])
        ], PdfAnnotationBase.prototype, "allowedInteractions", void 0);
        __decorate([
            ej2_base_1.Property(true)
        ], PdfAnnotationBase.prototype, "isPrint", void 0);
        __decorate([
            ej2_base_1.Property(false)
        ], PdfAnnotationBase.prototype, "isReadonly", void 0);
        __decorate([
            ej2_base_1.Property(0)
        ], PdfAnnotationBase.prototype, "pageRotation", void 0);
        __decorate([
            ej2_base_1.Property('')
        ], PdfAnnotationBase.prototype, "icon", void 0);
        __decorate([
            ej2_base_1.Property(false)
        ], PdfAnnotationBase.prototype, "isAddAnnotationProgrammatically", void 0);
        __decorate([
            ej2_base_1.Property(false)
        ], PdfAnnotationBase.prototype, "isTransparentSet", void 0);
        return PdfAnnotationBase;
    }(ej2_base_1.ChildProperty));
    exports.PdfAnnotationBase = PdfAnnotationBase;
    var PdfFormFieldBase = (function (_super) {
        __extends(PdfFormFieldBase, _super);
        function PdfFormFieldBase(parent, propName, defaultValue, isArray) {
            return _super.call(this, parent, propName, defaultValue, isArray) || this;
        }
        __decorate([
            ej2_base_1.Property('')
        ], PdfFormFieldBase.prototype, "id", void 0);
        __decorate([
            ej2_base_1.Property('')
        ], PdfFormFieldBase.prototype, "signatureType", void 0);
        __decorate([
            ej2_base_1.Property('')
        ], PdfFormFieldBase.prototype, "name", void 0);
        __decorate([
            ej2_base_1.Property('')
        ], PdfFormFieldBase.prototype, "value", void 0);
        __decorate([
            ej2_base_1.Property(null)
        ], PdfFormFieldBase.prototype, "formFieldAnnotationType", void 0);
        __decorate([
            ej2_base_1.Property('#daeaf7ff')
        ], PdfFormFieldBase.prototype, "backgroundColor", void 0);
        __decorate([
            ej2_base_1.Property('black')
        ], PdfFormFieldBase.prototype, "color", void 0);
        __decorate([
            ej2_base_1.Property('#303030')
        ], PdfFormFieldBase.prototype, "borderColor", void 0);
        __decorate([
            ej2_base_1.Property('')
        ], PdfFormFieldBase.prototype, "tooltip", void 0);
        __decorate([
            ej2_base_1.Property(1)
        ], PdfFormFieldBase.prototype, "opacity", void 0);
        __decorate([
            ej2_base_1.Property(1)
        ], PdfFormFieldBase.prototype, "thickness", void 0);
        __decorate([
            ej2_base_1.Property(0)
        ], PdfFormFieldBase.prototype, "rotateAngle", void 0);
        __decorate([
            ej2_base_1.Complex({ x: 0, y: 0 }, PdfBounds)
        ], PdfFormFieldBase.prototype, "bounds", void 0);
        __decorate([
            ej2_base_1.Property(0)
        ], PdfFormFieldBase.prototype, "pageIndex", void 0);
        __decorate([
            ej2_base_1.Property(1)
        ], PdfFormFieldBase.prototype, "pageNumber", void 0);
        __decorate([
            ej2_base_1.Property(-1)
        ], PdfFormFieldBase.prototype, "zIndex", void 0);
        __decorate([
            ej2_base_1.Property(null)
        ], PdfFormFieldBase.prototype, "wrapper", void 0);
        __decorate([
            ej2_base_1.Property(16)
        ], PdfFormFieldBase.prototype, "fontSize", void 0);
        __decorate([
            ej2_base_1.Property('Helvetica')
        ], PdfFormFieldBase.prototype, "fontFamily", void 0);
        __decorate([
            ej2_base_1.Property('None')
        ], PdfFormFieldBase.prototype, "fontStyle", void 0);
        __decorate([
            ej2_base_1.Property('left')
        ], PdfFormFieldBase.prototype, "alignment", void 0);
        __decorate([
            ej2_base_1.Property(0)
        ], PdfFormFieldBase.prototype, "minHeight", void 0);
        __decorate([
            ej2_base_1.Property(0)
        ], PdfFormFieldBase.prototype, "minWidth", void 0);
        __decorate([
            ej2_base_1.Property(0)
        ], PdfFormFieldBase.prototype, "maxHeight", void 0);
        __decorate([
            ej2_base_1.Property(0)
        ], PdfFormFieldBase.prototype, "maxWidth", void 0);
        __decorate([
            ej2_base_1.Property(0)
        ], PdfFormFieldBase.prototype, "maxLength", void 0);
        __decorate([
            ej2_base_1.Property('visible')
        ], PdfFormFieldBase.prototype, "visibility", void 0);
        __decorate([
            ej2_base_1.Property(true)
        ], PdfFormFieldBase.prototype, "isPrint", void 0);
        __decorate([
            ej2_base_1.Property(false)
        ], PdfFormFieldBase.prototype, "isReadonly", void 0);
        __decorate([
            ej2_base_1.Property(false)
        ], PdfFormFieldBase.prototype, "isChecked", void 0);
        __decorate([
            ej2_base_1.Property(false)
        ], PdfFormFieldBase.prototype, "isSelected", void 0);
        __decorate([
            ej2_base_1.Property(false)
        ], PdfFormFieldBase.prototype, "isRequired", void 0);
        __decorate([
            ej2_base_1.Property(false)
        ], PdfFormFieldBase.prototype, "isMultiline", void 0);
        __decorate([
            ej2_base_1.Property(false)
        ], PdfFormFieldBase.prototype, "isTransparent", void 0);
        __decorate([
            ej2_base_1.Property(false)
        ], PdfFormFieldBase.prototype, "insertSpaces", void 0);
        __decorate([
            ej2_base_1.Property('')
        ], PdfFormFieldBase.prototype, "options", void 0);
        __decorate([
            ej2_base_1.Property()
        ], PdfFormFieldBase.prototype, "signatureIndicatorSettings", void 0);
        __decorate([
            ej2_base_1.Complex({ isBold: false, isItalic: false, isStrikeout: false, isUnderline: false }, PdfFont)
        ], PdfFormFieldBase.prototype, "font", void 0);
        __decorate([
            ej2_base_1.Property()
        ], PdfFormFieldBase.prototype, "selectedIndex", void 0);
        __decorate([
            ej2_base_1.Property(null)
        ], PdfFormFieldBase.prototype, "customData", void 0);
        return PdfFormFieldBase;
    }(ej2_base_1.ChildProperty));
    exports.PdfFormFieldBase = PdfFormFieldBase;
    var ZOrderPageTable = (function () {
        function ZOrderPageTable() {
            this.pageIdTemp = 0;
            this.zIndexTemp = -1;
            this.childNodesTemp = [];
            this.objects = [];
            this.zIndexTemp = -1;
            this.pageIdTemp = 0;
        }
        Object.defineProperty(ZOrderPageTable.prototype, "pageId", {
            get: function () {
                return this.pageIdTemp;
            },
            set: function (offset) {
                this.pageIdTemp = offset;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(ZOrderPageTable.prototype, "zIndex", {
            get: function () {
                return this.zIndexTemp;
            },
            set: function (offset) {
                this.zIndexTemp = offset;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(ZOrderPageTable.prototype, "objects", {
            get: function () {
                return this.childNodesTemp;
            },
            set: function (childNodes) {
                this.childNodesTemp = childNodes;
            },
            enumerable: true,
            configurable: true
        });
        return ZOrderPageTable;
    }());
    exports.ZOrderPageTable = ZOrderPageTable;
});