@syncfusion/ej2-pdfviewer 17.3.48-4568 → 17.3.49-4568

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -17978,14 +17978,46 @@ var PdfViewerBase = /** @class */ (function () {
17978
17978
  * @private
17979
17979
  */
17980
17980
  this.isReRenderRequired = true;
17981
+ /**
17982
+ * @private
17983
+ */
17984
+ // eslint-disable-next-line
17985
+ this.isTouchPad = false;
17986
+ /**
17987
+ * @private
17988
+ */
17989
+ // eslint-disable-next-line
17990
+ this.isMacGestureActive = false;
17991
+ /**
17992
+ * @private
17993
+ */
17994
+ // eslint-disable-next-line
17995
+ this.macGestureStartScale = 0;
17996
+ /**
17997
+ * @private
17998
+ */
17999
+ // eslint-disable-next-line
18000
+ this.zoomInterval = 5;
18001
+ /**
18002
+ * @private
18003
+ */
18004
+ /**
18005
+ * EJ2CORE-813 - This flag is represent current device is 'iPad' or 'iPhone' or'iPod' device.
18006
+ * @private
18007
+ */
18008
+ // eslint-disable-next-line
18009
+ this.isDeviceiOS = (['iPad Simulator', 'iPhone Simulator', 'iPod Simulator', 'iPad', 'iPhone', 'iPod'].includes(navigator.platform) || (navigator.userAgent.includes("Mac") && "ontouchend" in document));
18010
+ /**
18011
+ * @private
18012
+ */
18013
+ // eslint-disable-next-line
18014
+ this.isMacSafari = navigator.userAgent.indexOf("Safari") > -1 && navigator.userAgent.indexOf("Chrome") === -1 && !this.isDeviceiOS;
17981
18015
  /**
17982
18016
  * @private
17983
18017
  */
17984
18018
  // tslint:disable-next-line
17985
18019
  this.previousContainerHeight = 0;
17986
18020
  this.isGotoPageEnabled = false;
17987
- this.taggedTextHandler = null;
17988
- this.taggedCollection = [];
17989
18021
  this.clearSessionStorage = function () {
17990
18022
  var documentId = window.sessionStorage.getItem('hashId');
17991
18023
  var documentLiveCount = window.sessionStorage.getItem('documentLiveCount');
@@ -18258,6 +18290,49 @@ var PdfViewerBase = /** @class */ (function () {
18258
18290
  _this.isViewerMouseDown = false;
18259
18291
  }
18260
18292
  };
18293
+ /**
18294
+ * @param {any} event - The Wheel event.
18295
+ * @returns {void}
18296
+ */
18297
+ this.detectTouchPad = function (event) {
18298
+ // eslint-disable-next-line max-len
18299
+ _this.isTouchPad = event.wheelDeltaY ? (event.wheelDeltaY === (event.deltaY * -3) ? true : Math.abs(event.deltaY) < 60) : (event.deltaMode === 0);
18300
+ };
18301
+ /**
18302
+ * @param {any} event - The Wheel event.
18303
+ * @returns {void}
18304
+ */
18305
+ this.handleMacGestureStart = function (event) {
18306
+ event.preventDefault();
18307
+ event.stopPropagation();
18308
+ _this.macGestureStartScale = _this.pdfViewer.magnification.zoomFactor;
18309
+ };
18310
+ /**
18311
+ * @param {any} event - The Wheel event.
18312
+ * @returns {void}
18313
+ */
18314
+ this.handleMacGestureChange = function (event) {
18315
+ event.preventDefault();
18316
+ event.stopPropagation();
18317
+ var macX = event.clientX;
18318
+ var macY = event.clientY;
18319
+ var scale = Number((_this.macGestureStartScale * event.scale).toFixed(2));
18320
+ if (!_this.isMacGestureActive) {
18321
+ _this.isMacGestureActive = true;
18322
+ _this.pdfViewer.magnification.initiateMouseZoom(macX, macY, scale * 100);
18323
+ setTimeout(function () {
18324
+ _this.isMacGestureActive = false;
18325
+ }, 70);
18326
+ }
18327
+ };
18328
+ /**
18329
+ * @param {any} event - The Wheel event.
18330
+ * @returns {void}
18331
+ */
18332
+ this.handleMacGestureEnd = function (event) {
18333
+ event.preventDefault();
18334
+ event.stopPropagation();
18335
+ };
18261
18336
  this.viewerContainerOnMouseWheel = function (event) {
18262
18337
  _this.isViewerMouseWheel = true;
18263
18338
  if (_this.getRerenderCanvasCreated()) {
@@ -18271,13 +18346,17 @@ var PdfViewerBase = /** @class */ (function () {
18271
18346
  if (_this.pdfViewer.magnification.zoomFactor >= 2) {
18272
18347
  zoomDifference = 50;
18273
18348
  }
18349
+ if (_this.isTouchPad && !_this.isMacSafari) {
18350
+ zoomDifference = zoomDifference / _this.zoomInterval;
18351
+ }
18274
18352
  // eslint-disable-next-line
18275
18353
  if (event.wheelDelta > 0) {
18276
- _this.pdfViewer.magnification.zoomTo((_this.pdfViewer.magnification.zoomFactor * 100) + zoomDifference);
18354
+ _this.pdfViewer.magnification.initiateMouseZoom(event.x, event.y, (_this.pdfViewer.magnification.zoomFactor * 100) + zoomDifference);
18277
18355
  }
18278
18356
  else {
18279
- _this.pdfViewer.magnification.zoomTo((_this.pdfViewer.magnification.zoomFactor * 100) - zoomDifference);
18357
+ _this.pdfViewer.magnification.initiateMouseZoom(event.x, event.y, (_this.pdfViewer.magnification.zoomFactor * 100) - zoomDifference);
18280
18358
  }
18359
+ _this.isTouchPad = false;
18281
18360
  }
18282
18361
  if (_this.pdfViewer.magnificationModule) {
18283
18362
  _this.pdfViewer.magnificationModule.pageRerenderOnMouseWheel();
@@ -18766,8 +18845,8 @@ var PdfViewerBase = /** @class */ (function () {
18766
18845
  _this.previousTime = new Date().getTime();
18767
18846
  // tslint:disable-next-line:max-line-length
18768
18847
  if (touchPoints.length === 1 && !(event.target.classList.contains('e-pv-touch-select-drop') || event.target.classList.contains('e-pv-touch-ellipse'))) {
18769
- if (Browser.isDevice && _this.pageCount > 0 && !_this.isThumb && !(event.target.classList.contains('e-pv-hyperlink'))) {
18770
- _this.handleTaps(touchPoints);
18848
+ if ((Browser.isDevice || (typeof navigator !== 'undefined' && navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1 && Browser.isTouch === true)) && _this.pageCount > 0 && !_this.isThumb && !(event.target.classList.contains('e-pv-hyperlink'))) {
18849
+ _this.handleTaps(touchPoints, event);
18771
18850
  }
18772
18851
  else if (!Browser.isDevice) {
18773
18852
  _this.handleTextBoxTaps(touchPoints);
@@ -18796,7 +18875,6 @@ var PdfViewerBase = /** @class */ (function () {
18796
18875
  _this.pdfViewer.textSelectionModule.initiateTouchSelection(event, _this.touchClientX, _this.touchClientY);
18797
18876
  if (Browser.isDevice) {
18798
18877
  clearTimeout(_this.singleTapTimer);
18799
- _this.singleTapTimer = null;
18800
18878
  _this.tapCount = 0;
18801
18879
  }
18802
18880
  }
@@ -19046,7 +19124,6 @@ var PdfViewerBase = /** @class */ (function () {
19046
19124
  this.pdfViewer = viewer;
19047
19125
  this.navigationPane = new NavigationPane(this.pdfViewer, this);
19048
19126
  this.textLayer = new TextLayer(this.pdfViewer, this);
19049
- this.taggedPdf = new TaggedPDF(this.pdfViewer, this);
19050
19127
  this.signatureModule = new Signature(this.pdfViewer, this);
19051
19128
  // tslint:disable-next-line:max-line-length
19052
19129
  this.isWebkitMobile = /Chrome/.test(navigator.userAgent) || /Google Inc/.test(navigator.vendor) || (navigator.userAgent.indexOf('Safari') !== -1);
@@ -19874,9 +19951,6 @@ var PdfViewerBase = /** @class */ (function () {
19874
19951
  if (this.renderedPagesList) {
19875
19952
  this.renderedPagesList = [];
19876
19953
  }
19877
- if (this.taggedCollection) {
19878
- this.taggedCollection = [];
19879
- }
19880
19954
  if (this.pageContainer) {
19881
19955
  while (this.pageContainer.hasChildNodes()) {
19882
19956
  this.pageContainer.removeChild(this.pageContainer.lastChild);
@@ -20314,7 +20388,16 @@ var PdfViewerBase = /** @class */ (function () {
20314
20388
  }
20315
20389
  this.viewerContainer.addEventListener('mousedown', this.viewerContainerOnMousedown);
20316
20390
  this.viewerContainer.addEventListener('mouseup', this.viewerContainerOnMouseup);
20391
+ this.viewerContainer.addEventListener("wheel", this.detectTouchPad, false);
20317
20392
  this.viewerContainer.addEventListener('wheel', this.viewerContainerOnMouseWheel);
20393
+ if (this.isMacSafari) {
20394
+ window.addEventListener('gesturestart', function (e) { return e.preventDefault(); });
20395
+ window.addEventListener('gesturechange', function (e) { return e.preventDefault(); });
20396
+ window.addEventListener('gestureend', function (e) { return e.preventDefault(); });
20397
+ this.viewerContainer.addEventListener('gesturestart', this.handleMacGestureStart, false);
20398
+ this.viewerContainer.addEventListener('gesturechange', this.handleMacGestureChange, false);
20399
+ this.viewerContainer.addEventListener('gestureend', this.handleMacGestureEnd, false);
20400
+ }
20318
20401
  this.viewerContainer.addEventListener('mousemove', this.viewerContainerOnMousemove);
20319
20402
  this.viewerContainer.addEventListener('mouseleave', this.viewerContainerOnMouseLeave);
20320
20403
  this.viewerContainer.addEventListener('mouseenter', this.viewerContainerOnMouseEnter);
@@ -20338,6 +20421,12 @@ var PdfViewerBase = /** @class */ (function () {
20338
20421
  }
20339
20422
  else {
20340
20423
  this.viewerContainer.addEventListener('touchstart', this.viewerContainerOnTouchStart);
20424
+ if (this.isWebkitMobile && this.isDeviceiOS) {
20425
+ // eslint-disable-next-line max-len
20426
+ this.viewerContainer.addEventListener("touchmove", function (e) { if (e.scale !== 1) {
20427
+ e.preventDefault();
20428
+ } }, { passive: false });
20429
+ }
20341
20430
  this.viewerContainer.addEventListener('touchmove', this.viewerContainerOnTouchMove);
20342
20431
  this.viewerContainer.addEventListener('touchend', this.viewerContainerOnTouchEnd);
20343
20432
  this.viewerContainer.addEventListener('touchleave', this.viewerContainerOnTouchEnd);
@@ -20351,7 +20440,16 @@ var PdfViewerBase = /** @class */ (function () {
20351
20440
  }
20352
20441
  this.viewerContainer.removeEventListener('mousedown', this.viewerContainerOnMousedown);
20353
20442
  this.viewerContainer.removeEventListener('mouseup', this.viewerContainerOnMouseup);
20443
+ this.viewerContainer.removeEventListener("wheel", this.detectTouchPad, false);
20354
20444
  this.viewerContainer.removeEventListener('wheel', this.viewerContainerOnMouseWheel);
20445
+ if (this.isMacSafari) {
20446
+ window.removeEventListener('gesturestart', function (e) { return e.preventDefault(); });
20447
+ window.removeEventListener('gesturechange', function (e) { return e.preventDefault(); });
20448
+ window.removeEventListener('gestureend', function (e) { return e.preventDefault(); });
20449
+ this.viewerContainer.removeEventListener('gesturestart', this.handleMacGestureStart, false);
20450
+ this.viewerContainer.removeEventListener('gesturechange', this.handleMacGestureChange, false);
20451
+ this.viewerContainer.removeEventListener('gestureend', this.handleMacGestureEnd, false);
20452
+ }
20355
20453
  this.viewerContainer.removeEventListener('mousemove', this.viewerContainerOnMousemove);
20356
20454
  this.viewerContainer.removeEventListener('mouseleave', this.viewerContainerOnMouseLeave);
20357
20455
  this.viewerContainer.removeEventListener('mouseenter', this.viewerContainerOnMouseEnter);
@@ -20372,6 +20470,12 @@ var PdfViewerBase = /** @class */ (function () {
20372
20470
  }
20373
20471
  else {
20374
20472
  this.viewerContainer.removeEventListener('touchstart', this.viewerContainerOnTouchStart);
20473
+ if (this.isWebkitMobile && this.isDeviceiOS) {
20474
+ // eslint-disable-next-line max-len
20475
+ this.viewerContainer.removeEventListener("touchmove", function (e) { if (e.scale !== 1) {
20476
+ e.preventDefault();
20477
+ } }, false);
20478
+ }
20375
20479
  this.viewerContainer.removeEventListener('touchmove', this.viewerContainerOnTouchMove);
20376
20480
  this.viewerContainer.removeEventListener('touchend', this.viewerContainerOnTouchEnd);
20377
20481
  this.viewerContainer.removeEventListener('touchleave', this.viewerContainerOnTouchEnd);
@@ -20487,30 +20591,66 @@ var PdfViewerBase = /** @class */ (function () {
20487
20591
  }
20488
20592
  this.isViewerContainerDoubleClick = false;
20489
20593
  };
20490
- PdfViewerBase.prototype.handleTaps = function (touchPoints) {
20594
+ PdfViewerBase.prototype.handleTaps = function (touchPoints, event) {
20491
20595
  var _this = this;
20492
- if (!this.singleTapTimer) {
20493
- this.singleTapTimer = setTimeout(function () {
20494
- _this.onSingleTap(touchPoints);
20495
- // tslint:disable-next-line
20496
- }, 300);
20497
- this.tapCount++;
20596
+ //EJ2CORE-813 - Implemented focus removing logic for iOS devices
20597
+ if (this.isDeviceiOS) {
20598
+ var obj = findActiveElement(event, this, this.pdfViewer);
20599
+ // eslint-disable-next-line
20600
+ var isRemoveFocus_1 = !this.pdfViewer.annotation.freeTextAnnotationModule.isNewFreeTextAnnot && (obj && this.pdfViewer.selectedItems.annotations[0] ? obj.id !== this.pdfViewer.selectedItems.annotations[0].id : true) && document.activeElement.classList.contains('free-text-input') && this.isFreeTextAnnotation(this.pdfViewer.selectedItems.annotations);
20601
+ if (!this.singleTapTimer) {
20602
+ this.singleTapTimer = setTimeout(function () {
20603
+ if (isRemoveFocus_1) {
20604
+ _this.pdfViewer.clearSelection(_this.pdfViewer.selectedItems.annotations[0].pageIndex);
20605
+ _this.focusViewerContainer();
20606
+ }
20607
+ _this.onSingleTap(touchPoints);
20608
+ // eslint-disable-next-line
20609
+ }, 300);
20610
+ this.tapCount++;
20611
+ }
20612
+ else {
20613
+ if (this.pdfViewer.enablePinchZoom) {
20614
+ this.tapCount++;
20615
+ clearTimeout(this.singleTapTimer);
20616
+ this.singleTapTimer = null;
20617
+ this.onDoubleTap(touchPoints);
20618
+ }
20619
+ }
20498
20620
  }
20499
20621
  else {
20500
- if (this.pdfViewer.enablePinchZoom) {
20622
+ if (!this.singleTapTimer) {
20623
+ this.singleTapTimer = setTimeout(function () {
20624
+ _this.onSingleTap(touchPoints);
20625
+ // eslint-disable-next-line
20626
+ }, 300);
20501
20627
  this.tapCount++;
20502
- clearTimeout(this.singleTapTimer);
20503
- this.singleTapTimer = null;
20504
- this.onDoubleTap(touchPoints);
20628
+ }
20629
+ else {
20630
+ if (this.pdfViewer.enablePinchZoom) {
20631
+ this.tapCount++;
20632
+ clearTimeout(this.singleTapTimer);
20633
+ this.singleTapTimer = null;
20634
+ this.onDoubleTap(touchPoints);
20635
+ }
20505
20636
  }
20506
20637
  }
20507
20638
  };
20508
20639
  PdfViewerBase.prototype.handleTextBoxTaps = function (touchPoints) {
20509
20640
  var _this = this;
20510
- setTimeout(function () { _this.inputTapCount = 0; }, 300);
20641
+ setTimeout(function () {
20642
+ _this.inputTapCount = 0;
20643
+ }, 300);
20511
20644
  this.inputTapCount++;
20512
- // tslint:disable-next-line
20513
- var timer = setTimeout(function () { _this.onTextBoxDoubleTap(touchPoints); }, 200);
20645
+ if (this.isDeviceiOS) {
20646
+ // eslint-disable-next-line
20647
+ this.onTextBoxDoubleTap(touchPoints);
20648
+ }
20649
+ else {
20650
+ var timer = setTimeout(function () {
20651
+ _this.onTextBoxDoubleTap(touchPoints);
20652
+ }, 200);
20653
+ }
20514
20654
  if (this.inputTapCount > 2) {
20515
20655
  this.inputTapCount = 0;
20516
20656
  }
@@ -20609,7 +20749,7 @@ var PdfViewerBase = /** @class */ (function () {
20609
20749
  if (this.pdfViewer.textSelectionModule) {
20610
20750
  // tslint:disable-next-line:max-line-length
20611
20751
  if (!this.isPanMode && this.pdfViewer.enableTextSelection && !this.isTextSelectionDisabled && this.getSelectTextMarkupCurrentPage() == null) {
20612
- if (!(this.isWebkitMobile && Browser.isDevice)) {
20752
+ if (!(this.isWebkitMobile && (Browser.isDevice || (typeof navigator !== 'undefined' && navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1 && Browser.isTouch === true)))) {
20613
20753
  event.preventDefault();
20614
20754
  event.stopPropagation();
20615
20755
  }
@@ -21057,14 +21197,6 @@ var PdfViewerBase = /** @class */ (function () {
21057
21197
  if (this.pdfViewer.textSelectionModule && !this.isTextSelectionDisabled) {
21058
21198
  this.pdfViewer.textSelectionModule.applySelectionRangeOnScroll(pageIndex);
21059
21199
  }
21060
- if (this.pdfViewer.taggedPDFModule && this.pdfViewer.enableTaggedPDF) {
21061
- if (this.taggedCollection[pageIndex.toString()]) {
21062
- this.renderTaggedTextContentsFromServer(pageIndex, this.taggedCollection[pageIndex.toString()]);
21063
- }
21064
- else {
21065
- this.createRequestForTaggedText(pageIndex);
21066
- }
21067
- }
21068
21200
  if (this.documentAnnotationCollections) {
21069
21201
  var isAnnotationAdded = false;
21070
21202
  for (var i = 0; i < this.annotationRenderredList.length; i++) {
@@ -21259,33 +21391,6 @@ var PdfViewerBase = /** @class */ (function () {
21259
21391
  }
21260
21392
  }
21261
21393
  };
21262
- PdfViewerBase.prototype.renderTaggedTextContentsFromServer = function (pageIndex, taggedTextResponse) {
21263
- this.taggedPdf.renderTaggedTextContentsFromServer(pageIndex, taggedTextResponse);
21264
- };
21265
- PdfViewerBase.prototype.createRequestForTaggedText = function (pageIndex) {
21266
- var jsonObject;
21267
- var proxy = this;
21268
- jsonObject = { action: 'RenderTaggedContent', elementId: this.pdfViewer.element.id, hashId: this.hashId, uniqueId: this.documentId, pageIndex: pageIndex };
21269
- if (this.jsonDocumentId) {
21270
- jsonObject.document = this.jsonDocumentId;
21271
- }
21272
- var url = this.pdfViewer.serviceUrl + '/' + "RenderTaggedContent";
21273
- this.taggedTextHandler = new AjaxHandler(this.pdfViewer);
21274
- this.taggedTextHandler.url = url;
21275
- this.taggedTextHandler.mode = true;
21276
- this.taggedTextHandler.responseType = 'text';
21277
- this.taggedTextHandler.send(jsonObject);
21278
- this.taggedTextHandler.onSuccess = function (result) {
21279
- var data = JSON.parse(result.data);
21280
- var pageData = data.filter(function (item) { return (item.PageNumber).toString() === pageIndex.toString(); });
21281
- proxy.taggedCollection[pageIndex.toString()] = pageData;
21282
- proxy.renderTaggedTextContentsFromServer(pageIndex, pageData);
21283
- };
21284
- this.taggedTextHandler.onFailure = function (result) {
21285
- console.log("error");
21286
- };
21287
- };
21288
-
21289
21394
  PdfViewerBase.prototype.renderPageContainer = function (pageNumber, pageWidth, pageHeight, topValue) {
21290
21395
  // tslint:disable-next-line:max-line-length
21291
21396
  var pageDiv = createElement('div', { id: this.pdfViewer.element.id + '_pageDiv_' + pageNumber, className: 'e-pv-page-div', attrs: { 'tabindex': '0' } });
@@ -24587,9 +24692,6 @@ var TextLayer = /** @class */ (function () {
24587
24692
  textLayer = createElement('div', { id: this.pdfViewer.element.id + '_textLayer_' + pageNumber, className: 'e-pv-text-layer' });
24588
24693
  textLayer.style.width = pageWidth + 'px';
24589
24694
  textLayer.style.height = pageHeight + 'px';
24590
- if (this.pdfViewer.taggedPDFModule && this.pdfViewer.enableTaggedPDF) {
24591
- textLayer.setAttribute('aria-hidden', 'true');
24592
- }
24593
24695
  pageDiv.appendChild(textLayer);
24594
24696
  }
24595
24697
  this.pdfViewerBase.applyElementStyles(textLayer, pageNumber);
@@ -25552,9 +25654,11 @@ var AjaxHandler = /** @class */ (function () {
25552
25654
  * @private
25553
25655
  */
25554
25656
  this.contentType = 'application/json;charset=UTF-8';
25657
+ this.retryTimeout = 0;
25555
25658
  this.pdfViewer = pdfviewer;
25556
25659
  this.retryCount = pdfviewer.retryCount;
25557
25660
  this.retryStatusCodes = pdfviewer.retryStatusCodes;
25661
+ this.retryTimeout = 1000 * pdfviewer.retryTimeout;
25558
25662
  }
25559
25663
  /**
25560
25664
  * Send the request to server
@@ -25564,6 +25668,7 @@ var AjaxHandler = /** @class */ (function () {
25564
25668
  AjaxHandler.prototype.send = function (jsonObj) {
25565
25669
  var _this = this;
25566
25670
  this.httpRequest = new XMLHttpRequest();
25671
+ this.httpRequest.timeout = this.retryTimeout;
25567
25672
  if (!this.mode) {
25568
25673
  setTimeout(function () { _this.sendRequest(jsonObj); });
25569
25674
  }
@@ -25579,7 +25684,22 @@ var AjaxHandler = /** @class */ (function () {
25579
25684
  _this.retryCount = 0;
25580
25685
  }
25581
25686
  if (_this.retryCount > 0) {
25582
- isSkip = _this.resendRequest(_this, jsonObj);
25687
+ isSkip = _this.resendRequest(_this, jsonObj, false);
25688
+ }
25689
+ if (!isSkip) {
25690
+ _this.stateChange(_this);
25691
+ }
25692
+ };
25693
+ this.httpRequest.ontimeout = function () {
25694
+ var isSkip = false;
25695
+ // tslint:disable-next-line
25696
+ var viewerBase = _this.pdfViewer.viewerBase;
25697
+ if (viewerBase && viewerBase.isPasswordAvailable && viewerBase.passwordData === '') {
25698
+ isSkip = true;
25699
+ _this.retryCount = 0;
25700
+ }
25701
+ if (_this.retryCount > 0) {
25702
+ isSkip = _this.resendRequest(_this, jsonObj, true);
25583
25703
  }
25584
25704
  if (!isSkip) {
25585
25705
  _this.stateChange(_this);
@@ -25588,7 +25708,7 @@ var AjaxHandler = /** @class */ (function () {
25588
25708
  this.httpRequest.onerror = function () { _this.error(_this); };
25589
25709
  };
25590
25710
  // tslint:disable-next-line
25591
- AjaxHandler.prototype.resendRequest = function (proxy, jsonObj) {
25711
+ AjaxHandler.prototype.resendRequest = function (proxy, jsonObj, isTimeout) {
25592
25712
  var isSkip = false;
25593
25713
  var status = proxy.httpRequest.status;
25594
25714
  var statusString = this.retryStatusCodes.indexOf(status) !== -1;
@@ -25615,7 +25735,7 @@ var AjaxHandler = /** @class */ (function () {
25615
25735
  }
25616
25736
  }
25617
25737
  }
25618
- if (statusString || isSkip) {
25738
+ if (statusString || isSkip || isTimeout) {
25619
25739
  isSkip = true;
25620
25740
  this.retryCount--;
25621
25741
  proxy.send(jsonObj);
@@ -26267,7 +26387,7 @@ var Magnification = /** @class */ (function () {
26267
26387
  this.scrollWidth = 25;
26268
26388
  this.zoomPercentages = [10, 25, 50, 75, 100, 125, 150, 200, 400];
26269
26389
  this.isNotPredefinedZoom = false;
26270
- this.pinchStep = 0.02;
26390
+ this.pinchStep = 0;
26271
26391
  this.reRenderPageNumber = 0;
26272
26392
  // tslint:disable-next-line
26273
26393
  this.magnifyPageRerenderTimer = null;
@@ -26277,6 +26397,8 @@ var Magnification = /** @class */ (function () {
26277
26397
  this.rerenderInterval = null;
26278
26398
  this.touchCenterX = 0;
26279
26399
  this.touchCenterY = 0;
26400
+ this.mouseCenterX = 0;
26401
+ this.mouseCenterY = 0;
26280
26402
  this.pageRerenderCount = 0;
26281
26403
  this.imageObjects = [];
26282
26404
  this.topValue = 0;
@@ -26313,6 +26435,10 @@ var Magnification = /** @class */ (function () {
26313
26435
  * @private
26314
26436
  */
26315
26437
  this.isAutoZoom = false;
26438
+ /**
26439
+ * @private
26440
+ */
26441
+ this.isDoubleTapZoom = false;
26316
26442
  this.isWebkitMobile = false;
26317
26443
  this.pdfViewer = pdfViewer;
26318
26444
  this.pdfViewerBase = viewerBase;
@@ -26326,11 +26452,13 @@ var Magnification = /** @class */ (function () {
26326
26452
  * @returns void
26327
26453
  */
26328
26454
  Magnification.prototype.zoomTo = function (zoomValue) {
26329
- if (zoomValue < 10) {
26330
- zoomValue = 10;
26455
+ var MaximumZoomPercentage = 400;
26456
+ var MinmumZoomPercentage = 10;
26457
+ if (zoomValue < MinmumZoomPercentage) {
26458
+ zoomValue = MinmumZoomPercentage;
26331
26459
  }
26332
- else if (zoomValue > 400) {
26333
- zoomValue = 400;
26460
+ else if (zoomValue > MaximumZoomPercentage) {
26461
+ zoomValue = MaximumZoomPercentage;
26334
26462
  }
26335
26463
  this.fitType = null;
26336
26464
  this.isNotPredefinedZoom = false;
@@ -26470,6 +26598,16 @@ var Magnification = /** @class */ (function () {
26470
26598
  return parseInt(((viewerHeight / highestHeight) * 100).toString());
26471
26599
  }
26472
26600
  };
26601
+ /**
26602
+ * Initiating cursor based zoom.
26603
+ * @private
26604
+ */
26605
+ Magnification.prototype.initiateMouseZoom = function (pointX, pointY, zoomValue) {
26606
+ var pointInViewer = this.positionInViewer(pointX, pointY);
26607
+ this.mouseCenterX = pointInViewer.x;
26608
+ this.mouseCenterY = pointInViewer.y;
26609
+ this.zoomTo(zoomValue);
26610
+ };
26473
26611
  /**
26474
26612
  * Performs pinch in operation
26475
26613
  */
@@ -26479,8 +26617,11 @@ var Magnification = /** @class */ (function () {
26479
26617
  if (temporaryZoomFactor < 4 && temporaryZoomFactor > 2) {
26480
26618
  temporaryZoomFactor = this.zoomFactor - this.pinchStep;
26481
26619
  }
26482
- if (temporaryZoomFactor < 0.1) {
26483
- temporaryZoomFactor = 0.1;
26620
+ if (temporaryZoomFactor <= 1.5) {
26621
+ temporaryZoomFactor = this.zoomFactor - (this.pinchStep / 1.5);
26622
+ }
26623
+ if (temporaryZoomFactor < 0.25) {
26624
+ temporaryZoomFactor = 0.25;
26484
26625
  }
26485
26626
  this.isPinchZoomed = true;
26486
26627
  this.onZoomChanged(temporaryZoomFactor * 100);
@@ -26500,8 +26641,8 @@ var Magnification = /** @class */ (function () {
26500
26641
  this.fitType = null;
26501
26642
  var temporaryZoomFactor = this.zoomFactor + this.pinchStep;
26502
26643
  if (Browser.isDevice) {
26503
- if (temporaryZoomFactor > 2) {
26504
- temporaryZoomFactor = 2;
26644
+ if (temporaryZoomFactor > 4) {
26645
+ temporaryZoomFactor = 4;
26505
26646
  }
26506
26647
  }
26507
26648
  else {
@@ -26599,8 +26740,9 @@ var Magnification = /** @class */ (function () {
26599
26740
  * @private
26600
26741
  */
26601
26742
  Magnification.prototype.setTouchPoints = function (clientX, clientY) {
26602
- this.touchCenterX = clientX;
26603
- this.touchCenterY = clientY;
26743
+ var pointInViewer = this.positionInViewer(clientX, clientY);
26744
+ this.touchCenterX = pointInViewer.x;
26745
+ this.touchCenterY = pointInViewer.y;
26604
26746
  };
26605
26747
  /**
26606
26748
  * @private
@@ -26609,8 +26751,9 @@ var Magnification = /** @class */ (function () {
26609
26751
  this.isPinchScrolled = false;
26610
26752
  this.isMagnified = false;
26611
26753
  this.reRenderPageNumber = this.pdfViewerBase.currentPageNumber;
26612
- this.touchCenterX = (pointX1 + pointX2) / 2;
26613
- this.touchCenterY = (pointY1 + pointY2) / 2;
26754
+ var pointInViewer = this.positionInViewer((pointX1 + pointX2) / 2, (pointY1 + pointY2) / 2);
26755
+ this.touchCenterX = pointInViewer.x;
26756
+ this.touchCenterY = pointInViewer.y;
26614
26757
  this.zoomOverPages(pointX1, pointY1, pointX2, pointY2);
26615
26758
  };
26616
26759
  Magnification.prototype.magnifyPages = function () {
@@ -26621,7 +26764,7 @@ var Magnification = /** @class */ (function () {
26621
26764
  if (!this.pdfViewerBase.documentLoaded) {
26622
26765
  this.isPagesZoomed = true;
26623
26766
  }
26624
- var scrollValue = this.getMagnifiedValue(this.pdfViewerBase.viewerContainer.scrollTop);
26767
+ var scrollValue = this.pdfViewerBase.viewerContainer.scrollTop;
26625
26768
  if (this.pdfViewer.textSelectionModule) {
26626
26769
  this.pdfViewer.textSelectionModule.maintainSelectionOnZoom(false, true);
26627
26770
  }
@@ -26630,6 +26773,7 @@ var Magnification = /** @class */ (function () {
26630
26773
  }
26631
26774
  this.updatePageLocation();
26632
26775
  this.resizeCanvas(this.reRenderPageNumber);
26776
+ this.calculateScrollValuesOnMouse(scrollValue);
26633
26777
  if (this.pdfViewer.textSelectionModule) {
26634
26778
  this.pdfViewer.textSelectionModule.resizeTouchElements();
26635
26779
  }
@@ -26645,7 +26789,6 @@ var Magnification = /** @class */ (function () {
26645
26789
  var proxy_1 = this;
26646
26790
  this.pdfViewerBase.renderedPagesList = [];
26647
26791
  this.pdfViewerBase.pinchZoomStorage = [];
26648
- this.pdfViewerBase.viewerContainer.scrollTop = scrollValue;
26649
26792
  if (!this.pdfViewerBase.documentLoaded) {
26650
26793
  this.magnifyPageRerenderTimer = setTimeout(function () { proxy_1.rerenderMagnifiedPages(); }, 800);
26651
26794
  }
@@ -26755,22 +26898,66 @@ var Magnification = /** @class */ (function () {
26755
26898
  var pageIndex = this.pdfViewerBase.currentPageNumber - 1;
26756
26899
  var currentPageCanvas = this.pdfViewerBase.getElement('_pageDiv_' + pageIndex);
26757
26900
  if (currentPageCanvas) {
26901
+ var pointInViewer = void 0;
26758
26902
  var currentPageBounds = currentPageCanvas.getBoundingClientRect();
26903
+ if (this.pdfViewer.enableRtl && !this.isDoubleTapZoom) {
26904
+ pointInViewer = this.positionInViewer(currentPageBounds.right, currentPageBounds.top);
26905
+ }
26906
+ else {
26907
+ pointInViewer = this.positionInViewer(currentPageBounds.left, currentPageBounds.top);
26908
+ }
26909
+ var currentPageBoundsLeft = pointInViewer.x;
26910
+ var currentPageBoundsTop = pointInViewer.y;
26759
26911
  // update scroll top for the viewer container based on pinch zoom factor
26760
- var previousPageTop = (currentPageBounds.top) * this.previousZoomFactor;
26761
- var previousY = scrollValue + this.touchCenterY;
26762
- // tslint:disable-next-line:max-line-length
26763
- var currentY = (currentPageBounds.top) * this.zoomFactor + ((previousY - previousPageTop) < 0 ? previousY - previousPageTop : (previousY -
26764
- // tslint:disable-next-line:max-line-length
26912
+ var previousPageTop = (currentPageBoundsTop) * this.previousZoomFactor;
26913
+ var canvasPreviousY = scrollValue + this.touchCenterY;
26914
+ // eslint-disable-next-line max-len
26915
+ var canvasCurrentY = (currentPageBoundsTop) * this.zoomFactor + ((canvasPreviousY - previousPageTop) < 0 ? canvasPreviousY - previousPageTop : (canvasPreviousY -
26916
+ // eslint-disable-next-line max-len
26765
26917
  previousPageTop) * (this.zoomFactor / this.previousZoomFactor));
26766
- this.pdfViewerBase.viewerContainer.scrollTop = currentY - this.touchCenterY;
26918
+ var pageGapValue = this.zoomFactor - this.previousZoomFactor > 0 ? -this.pdfViewerBase.pageGap * (this.zoomFactor / this.previousZoomFactor) : this.pdfViewerBase.pageGap * (this.previousZoomFactor / this.zoomFactor);
26919
+ this.pdfViewerBase.viewerContainer.scrollTop = canvasCurrentY - this.touchCenterY + pageGapValue / this.pdfViewerBase.zoomInterval;
26767
26920
  // update scroll left for the viewer container based on pinch zoom factor
26768
- var prevValue = (currentPageBounds.width * this.previousZoomFactor) / currentPageBounds.width;
26769
- var scaleCorrectionFactor = this.zoomFactor / prevValue - 1;
26770
- var scrollX_1 = this.touchCenterX - currentPageBounds.left;
26921
+ var previousWidthFactor = (currentPageBounds.width * this.previousZoomFactor) / currentPageBounds.width;
26922
+ var scaleCorrectionFactor = this.zoomFactor / previousWidthFactor - 1;
26923
+ var scrollX_1 = this.touchCenterX - currentPageBoundsLeft;
26771
26924
  this.pdfViewerBase.viewerContainer.scrollLeft += scrollX_1 * scaleCorrectionFactor;
26772
26925
  }
26773
26926
  };
26927
+ Magnification.prototype.calculateScrollValuesOnMouse = function (scrollValue) {
26928
+ var pageIndex = this.pdfViewerBase.currentPageNumber - 1;
26929
+ var currentPageCanvas = this.pdfViewerBase.getElement('_pageDiv_' + pageIndex);
26930
+ if (currentPageCanvas) {
26931
+ var pointInViewer = void 0;
26932
+ var currentPageBounds = currentPageCanvas.getBoundingClientRect();
26933
+ if (this.pdfViewer.enableRtl) {
26934
+ pointInViewer = this.positionInViewer(currentPageBounds.right, currentPageBounds.top);
26935
+ }
26936
+ else {
26937
+ pointInViewer = this.positionInViewer(currentPageBounds.left, currentPageBounds.top);
26938
+ }
26939
+ var currentPageBoundsLeft = pointInViewer.x;
26940
+ var currentPageBoundsTop = pointInViewer.y;
26941
+ // update scroll top for the viewer container based on mouse zoom factor
26942
+ var previousPageTop = (currentPageBoundsTop) * this.previousZoomFactor;
26943
+ var canvasPreviousY = scrollValue + this.mouseCenterY;
26944
+ // eslint-disable-next-line max-len
26945
+ var canvasCurrentY = (currentPageBoundsTop) * this.zoomFactor + ((canvasPreviousY - previousPageTop) < 0 ? canvasPreviousY - previousPageTop : (canvasPreviousY -
26946
+ // eslint-disable-next-line max-len
26947
+ previousPageTop) * (this.zoomFactor / this.previousZoomFactor));
26948
+ // eslint-disable-next-line max-len
26949
+ var pageGapValue = this.zoomFactor - this.previousZoomFactor > 0 ? -this.pdfViewerBase.pageGap * (this.zoomFactor / this.previousZoomFactor) : this.pdfViewerBase.pageGap * (this.previousZoomFactor / this.zoomFactor);
26950
+ if (this.pdfViewerBase.isTouchPad && !this.pdfViewerBase.isMacSafari) {
26951
+ pageGapValue = pageGapValue / this.pdfViewerBase.zoomInterval;
26952
+ }
26953
+ this.pdfViewerBase.viewerContainer.scrollTop = canvasCurrentY - this.mouseCenterY + pageGapValue;
26954
+ // update scroll left for the viewer container based on mouse zoom factor
26955
+ var previousWidthFactor = (currentPageBounds.width * this.previousZoomFactor) / currentPageBounds.width;
26956
+ var scaleCorrectionFactor = this.zoomFactor / previousWidthFactor - 1;
26957
+ var scrollX_2 = this.mouseCenterX - currentPageBoundsLeft;
26958
+ this.pdfViewerBase.viewerContainer.scrollLeft += scrollX_2 * scaleCorrectionFactor;
26959
+ }
26960
+ };
26774
26961
  Magnification.prototype.rerenderOnScroll = function () {
26775
26962
  var _this = this;
26776
26963
  this.isPinchZoomed = false;
@@ -27133,9 +27320,11 @@ var Magnification = /** @class */ (function () {
27133
27320
  var currentDifference = Math.sqrt(Math.pow((pointX1 - pointX2), 2) + Math.pow((pointY1 - pointY2), 2));
27134
27321
  if (this.previousTouchDifference > -1) {
27135
27322
  if (currentDifference > this.previousTouchDifference) {
27323
+ this.pinchStep = this.getPinchStep(currentDifference, this.previousTouchDifference);
27136
27324
  this.pinchOut();
27137
27325
  }
27138
27326
  else if (currentDifference < this.previousTouchDifference) {
27327
+ this.pinchStep = this.getPinchStep(this.previousTouchDifference, currentDifference);
27139
27328
  this.pinchIn();
27140
27329
  }
27141
27330
  }
@@ -27248,19 +27437,23 @@ var Magnification = /** @class */ (function () {
27248
27437
  this.pdfViewer.toolbarModule.showToolbar(false);
27249
27438
  }
27250
27439
  var scrollValue = this.pdfViewerBase.viewerContainer.scrollTop;
27251
- if (!this.isTapToFitZoom) {
27252
- if (this.zoomFactor < 2) {
27253
- this.zoomTo(200);
27440
+ if (!this.pdfViewer.selectedItems.annotations[0]) {
27441
+ this.isDoubleTapZoom = true;
27442
+ if (!this.isTapToFitZoom) {
27443
+ if (this.zoomFactor < 2) {
27444
+ this.zoomTo(200);
27445
+ }
27446
+ else {
27447
+ this.fitToWidth();
27448
+ }
27254
27449
  }
27255
27450
  else {
27256
27451
  this.fitToWidth();
27257
27452
  }
27453
+ this.calculateScrollValues(scrollValue);
27454
+ this.isTapToFitZoom = !this.isTapToFitZoom;
27455
+ this.isDoubleTapZoom = false;
27258
27456
  }
27259
- else {
27260
- this.fitToWidth();
27261
- }
27262
- this.calculateScrollValues(scrollValue);
27263
- this.isTapToFitZoom = !this.isTapToFitZoom;
27264
27457
  };
27265
27458
  Magnification.prototype.downwardScrollFitPage = function (currentPageIndex) {
27266
27459
  if (currentPageIndex !== (this.pdfViewerBase.pageCount - 1)) {
@@ -27295,6 +27488,32 @@ var Magnification = /** @class */ (function () {
27295
27488
  Magnification.prototype.getModuleName = function () {
27296
27489
  return 'Magnification';
27297
27490
  };
27491
+ /**
27492
+ * Returns the pinch step value.
27493
+ * @param higherValue
27494
+ * @param lowerValue
27495
+ */
27496
+ Magnification.prototype.getPinchStep = function (higherValue, lowerValue) {
27497
+ var defaultPinchStep = 0.02; // Default pinch step value.
27498
+ var higherPinchStep = 1; // higher pinch step value.
27499
+ var pinchstep = (higherValue - lowerValue) / 100;
27500
+ if (pinchstep < defaultPinchStep) {
27501
+ pinchstep = defaultPinchStep;
27502
+ }
27503
+ else if (pinchstep > higherPinchStep) {
27504
+ pinchstep = 0.1; // set the pinch step as 0.1 if the pinch reaches the higher pinch step value.
27505
+ }
27506
+ return pinchstep;
27507
+ };
27508
+ /**
27509
+ * Returns Point value respect to Main container.
27510
+ * @param pointX
27511
+ * @param pointY
27512
+ */
27513
+ Magnification.prototype.positionInViewer = function (pointX, pointY) {
27514
+ var mainRect = this.pdfViewerBase.mainContainer.getBoundingClientRect();
27515
+ return { x: pointX - mainRect.left, y: pointY - mainRect.top };
27516
+ };
27298
27517
  return Magnification;
27299
27518
  }());
27300
27519
 
@@ -28045,7 +28264,9 @@ var Toolbar$1 = /** @class */ (function () {
28045
28264
  Toolbar$$1.prototype.showToolbar = function (enableToolbar) {
28046
28265
  var toolbar = this.toolbarElement;
28047
28266
  if (enableToolbar) {
28048
- toolbar.style.display = 'block';
28267
+ if (toolbar) {
28268
+ toolbar.style.display = 'block';
28269
+ }
28049
28270
  if (Browser.isDevice && this.pdfViewer.toolbarModule && this.pdfViewer.toolbarModule.annotationToolbarModule) {
28050
28271
  this.pdfViewer.toolbarModule.annotationToolbarModule.hideMobileAnnotationToolbar();
28051
28272
  }
@@ -35921,20 +36142,6 @@ var PdfViewer = /** @class */ (function (_super) {
35921
36142
  enumerable: true,
35922
36143
  configurable: true
35923
36144
  });
35924
- Object.defineProperty(PdfViewer.prototype, "taggedPdf", {
35925
- /**
35926
- * Gets the tagged layer object of the pdf viewer.
35927
- *
35928
- * @asptype TaggedPDF
35929
- * @blazorType TaggedPDF
35930
- * @returns { TaggedPDF }
35931
- */
35932
- get: function () {
35933
- return this.taggedPDFModule;
35934
- },
35935
- enumerable: true,
35936
- configurable: true
35937
- });
35938
36145
  Object.defineProperty(PdfViewer.prototype, "toolbar", {
35939
36146
  /**
35940
36147
  * Gets the toolbar object of the pdf viewer.
@@ -36168,11 +36375,6 @@ var PdfViewer = /** @class */ (function (_super) {
36168
36375
  member: 'FormFields', args: [this, this.viewerBase]
36169
36376
  });
36170
36377
  }
36171
- if (this.enableTaggedPDF) {
36172
- modules.push({
36173
- member: 'TaggedPDF', args: [this, this.viewerBase]
36174
- });
36175
- }
36176
36378
  return modules;
36177
36379
  };
36178
36380
  /**
@@ -37023,15 +37225,15 @@ var PdfViewer = /** @class */ (function (_super) {
37023
37225
  __decorate$2([
37024
37226
  Property(true)
37025
37227
  ], PdfViewer.prototype, "enableZoomOptimization", void 0);
37026
- __decorate$2([
37027
- Property(false)
37028
- ], PdfViewer.prototype, "isExtractText", void 0);
37029
- __decorate$2([
37030
- Property(true)
37031
- ], PdfViewer.prototype, "enableTaggedPDF", void 0);
37032
37228
  __decorate$2([
37033
37229
  Property([500])
37034
37230
  ], PdfViewer.prototype, "retryStatusCodes", void 0);
37231
+ __decorate$2([
37232
+ Property(0)
37233
+ ], PdfViewer.prototype, "retryTimeout", void 0);
37234
+ __decorate$2([
37235
+ Property(false)
37236
+ ], PdfViewer.prototype, "isExtractText", void 0);
37035
37237
  __decorate$2([
37036
37238
  Property({ showTooltip: true, toolbarItems: ['OpenOption', 'UndoRedoTool', 'PageNavigationTool', 'MagnificationTool', 'PanTool', 'SelectionTool', 'CommentTool', 'AnnotationEditTool', 'FreeTextAnnotationOption', 'InkAnnotationOption', 'ShapeAnnotationOption', 'StampAnnotation', 'SignatureOption', 'SearchOption', 'PrintOption', 'DownloadOption'] })
37037
37239
  ], PdfViewer.prototype, "toolbarSettings", void 0);
@@ -41891,204 +42093,6 @@ var FormFields = /** @class */ (function () {
41891
42093
  return FormFields;
41892
42094
  }());
41893
42095
 
41894
- /**
41895
- * export types
41896
- */
41897
-
41898
- /**
41899
- * Tagged PDF module is used to handle tagged pdf document
41900
- *
41901
- * @hidden
41902
- */
41903
- var TaggedPDF = /** @class */ (function () {
41904
- /**
41905
- * @param {PdfViewer} pdfViewer - The PdfViewer.
41906
- * @param {PdfViewerBase} pdfViewerBase - The PdfViewerBase.
41907
- * @private
41908
- */
41909
- function TaggedPDF(pdfViewer, pdfViewerBase) {
41910
- this.createTag = function (taggedTextResponse) {
41911
- var _this = this;
41912
- var tagType = taggedTextResponse.TagType;
41913
- var parentTagType = taggedTextResponse.ParentTagType;
41914
- var text = taggedTextResponse.Text;
41915
- var altText = taggedTextResponse.AltText;
41916
- var bounds = taggedTextResponse.Bounds;
41917
- var childTags = taggedTextResponse.ChildElements;
41918
- var textTag = document.createElement(this.getTag(tagType));
41919
- textTag.style = "padding:0px;margin:0px";
41920
- if (parentTagType != "Document" && parentTagType != "Part") {
41921
- textTag.style.position = 'absolute';
41922
- }
41923
- if (bounds) {
41924
- this.setStyleToTaggedTextDiv(textTag, bounds);
41925
- this.setTextElementProperties(textTag);
41926
- }
41927
- if (text.trim() != "") {
41928
- textTag.innerText = text;
41929
- }
41930
- if (altText && altText.trim() !== "" && (tagType === "Image" || tagType === "Figure")) {
41931
- textTag.alt = altText;
41932
- textTag.src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNgYAAAAAMAASsJTYQAAAAASUVORK5CYII=";
41933
- }
41934
- if (childTags && childTags.length > 0) {
41935
- childTags.forEach(function (element) {
41936
- if (tagType === "Table") {
41937
- element.ChildElements.forEach(function (newelement) {
41938
- textTag.appendChild(_this.createTag(newelement));
41939
- });
41940
- }
41941
- else {
41942
- textTag.appendChild(_this.createTag(element));
41943
- }
41944
- });
41945
- }
41946
- return textTag;
41947
- };
41948
- this.pdfViewer = pdfViewer;
41949
- this.pdfViewerBase = pdfViewerBase;
41950
- }
41951
- TaggedPDF.prototype.addTaggedLayer = function (pageIndex) {
41952
- var taggedLayer;
41953
- if (this.pdfViewer.enableTaggedPDF) {
41954
- var pageDiv = document.getElementById(this.pdfViewer.element.id + '_pageDiv_' + pageIndex);
41955
- taggedLayer = document.getElementById(this.pdfViewer.element.id + '_taggedLayer_' + pageIndex);
41956
- if (!taggedLayer) {
41957
- taggedLayer = createElement('div', { id: this.pdfViewer.element.id + '_taggedLayer_' + pageIndex, className: 'e-pv-tagged-layer e-pv-text-layer' });
41958
- }
41959
- taggedLayer.innerHTML = "";
41960
- taggedLayer.style.width = this.pdfViewerBase.pageSize[parseInt(pageIndex.toString(), 10)].width * this.pdfViewerBase.getZoomFactor() + 'px';
41961
- taggedLayer.style.height = this.pdfViewerBase.pageSize[parseInt(pageIndex.toString(), 10)].height * this.pdfViewerBase.getZoomFactor() + 'px';
41962
- taggedLayer.style.pointerEvents = "none";
41963
- if (pageDiv) {
41964
- pageDiv.appendChild(taggedLayer);
41965
- }
41966
- }
41967
- return taggedLayer;
41968
- };
41969
- TaggedPDF.prototype.renderTaggedTextContentsFromServer = function (pageIndex, taggedTextResponse) {
41970
- var taggedLayer = this.addTaggedLayer(pageIndex);
41971
- for (var i = 0; i < taggedTextResponse.length; i++) {
41972
- var textDiv = createElement('div', { id: this.pdfViewer.element.id + '_taggedText_' + pageIndex + '_' + i, className: 'e-pv-text', attrs: { 'tabindex': '-1' } });
41973
- var bounds = taggedTextResponse[i].Bounds;
41974
- if (taggedTextResponse[i].TagType === "Paragraph" && taggedTextResponse[i].ChildElements === null && taggedTextResponse[i].Text.trim() === "") {
41975
- continue;
41976
- }
41977
- else {
41978
- textDiv.appendChild(this.createTag(taggedTextResponse[i]));
41979
- }
41980
- textDiv.style.display = "inline";
41981
- this.setStyleToTaggedTextDiv(textDiv, bounds);
41982
- this.setTextElementProperties(textDiv);
41983
- taggedLayer.appendChild(textDiv);
41984
- }
41985
- };
41986
- TaggedPDF.prototype.getTag = function (tagType) {
41987
- switch (tagType) {
41988
- case "Paragraph":
41989
- return "p";
41990
- case "Figure":
41991
- return "img";
41992
- case "Article":
41993
- return "art";
41994
- case "Annotation":
41995
- return "annot";
41996
- case "BibliographyEntry":
41997
- return "bibentry";
41998
- case "BlockQuotation":
41999
- return "blockQuote";
42000
- case "Caption":
42001
- return "caption";
42002
- case "Code":
42003
- return "code";
42004
- case "Division":
42005
- return "div";
42006
- case "Document":
42007
- return "document";
42008
- case "Form":
42009
- return "form";
42010
- case "Formula":
42011
- return "formula";
42012
- case "Index":
42013
- return "index";
42014
- case "Heading":
42015
- return "h";
42016
- case "HeadingLevel1":
42017
- return "h1";
42018
- case "HeadingLevel2":
42019
- return "h2";
42020
- case "HeadingLevel3":
42021
- return "h3";
42022
- case "HeadingLevel4":
42023
- return "h4";
42024
- case "HeadingLevel5":
42025
- return "h5";
42026
- case "HeadingLevel6":
42027
- return "h6";
42028
- case "Label":
42029
- return "label";
42030
- case "Link":
42031
- return "a";
42032
- case "List":
42033
- return "ul";
42034
- case "ListItem":
42035
- return "li";
42036
- case "ListBody":
42037
- return "p";
42038
- case "Note":
42039
- return "note";
42040
- case "Part":
42041
- return "part";
42042
- case "Quotation":
42043
- return "quote";
42044
- case "Reference":
42045
- return "reference";
42046
- case "Section":
42047
- return "sect";
42048
- case "Span":
42049
- return "span";
42050
- case "Table":
42051
- return "table";
42052
- case "TableDataCell":
42053
- return "td";
42054
- case "TableHeader":
42055
- return "th";
42056
- case "TableOfContent":
42057
- return "toc";
42058
- case "TableOfContentItem":
42059
- return "toci";
42060
- case "TableRow":
42061
- return "tr";
42062
- case "Image":
42063
- return "img";
42064
- default:
42065
- return "p";
42066
- }
42067
- };
42068
-
42069
- TaggedPDF.prototype.setStyleToTaggedTextDiv = function (textDiv, bounds) {
42070
- textDiv.style.left = bounds.X * (96 / 72) * this.pdfViewerBase.getZoomFactor() + 'px';
42071
- textDiv.style.top = bounds.Y * (96 / 72) * this.pdfViewerBase.getZoomFactor() + 'px';
42072
- textDiv.style.width = bounds.Width * (96 / 72) * this.pdfViewerBase.getZoomFactor() + 'px';
42073
- var textHeight = bounds.Height * (96 / 72) * this.pdfViewerBase.getZoomFactor();
42074
- textDiv.style.height = textHeight + 'px';
42075
- textDiv.style.fontSize = 16 * this.pdfViewerBase.getZoomFactor() + 'px';
42076
- textDiv.style.color = 'transparent';
42077
- };
42078
-
42079
- TaggedPDF.prototype.setTextElementProperties = function (textDiv) {
42080
- textDiv.style.fontFamily = 'serif';
42081
- textDiv.style.transformOrigin = '0%';
42082
- };
42083
- /**
42084
- * @private
42085
- */
42086
- TaggedPDF.prototype.getModuleName = function () {
42087
- return 'TaggedPDF';
42088
- };
42089
- return TaggedPDF;
42090
- }());
42091
-
42092
42096
  /**
42093
42097
  * export types
42094
42098
  */
@@ -42105,5 +42109,5 @@ var TaggedPDF = /** @class */ (function () {
42105
42109
  * export PDF viewer modules
42106
42110
  */
42107
42111
 
42108
- export { Annotation, LinkAnnotation, TextMarkupAnnotation, MeasureAnnotation, ShapeAnnotation, StampAnnotation, StickyNotesAnnotation, FreeTextAnnotation, InputElement, NavigationPane, PdfViewerBase, TextLayer, ContextMenu$1 as ContextMenu, FontStyle, AnnotationResizerLocation, CursorType, AjaxHandler, Signature, Magnification, Navigation, ThumbnailView, Toolbar$1 as Toolbar, AnnotationToolbar, ToolbarSettings, AjaxRequestSettings, CustomStampItem, AnnotationToolbarSettings, ServerActionSettings, StrikethroughSettings, UnderlineSettings, HighlightSettings, LineSettings, ArrowSettings, RectangleSettings, CircleSettings, ShapeLabelSettings, PolygonSettings, StampSettings, CustomStampSettings, DistanceSettings, PerimeterSettings, AreaSettings, RadiusSettings, VolumeSettings, StickyNotesSettings, MeasurementSettings, FreeTextSettings, AnnotationSelectorSettings, TextSearchColorSettings, HandWrittenSignatureSettings, AnnotationSettings, DocumentTextCollectionSettings, TextDataSettings, RectangleBounds, TileRenderingSettings, ScrollSettings, PdfViewer, BookmarkView, TextSelection, TextSearch, Print, FormFields, TaggedPDF, Drawing, findActiveElement, findObjectsUnderMouse, findObjectUnderMouse, CalculateLeaderPoints, findElementUnderMouse, insertObject, findTargetShapeElement, findObjects, findActivePage, ActiveElements, getConnectorPoints, getSegmentPath, updateSegmentElement, getSegmentElement, updateDecoratorElement, getDecoratorElement, clipDecorators, clipDecorator, initDistanceLabel, updateDistanceLabel, updateRadiusLabel, initPerimeterLabel, updatePerimeterLabel, removePerimeterLabel, updateCalibrateLabel, getPolygonPath, textElement, initLeaders, initLeader, isPointOverConnector, findNearestPoint, getDecoratorShape, renderAdornerLayer, createSvg, isLineShapes, setElementStype, findPointsLength, findPerimeterLength, getBaseShapeAttributes, getFunction, cloneObject, cloneArray, getInternalProperties, isLeader, PdfBounds, PdfFont, PdfAnnotationBase, ZOrderPageTable, Selector, ToolBase, SelectTool, MoveTool, StampTool, ConnectTool, ResizeTool, NodeDrawingTool, PolygonDrawingTool, LineTool, RotateTool };
42112
+ export { Annotation, LinkAnnotation, TextMarkupAnnotation, MeasureAnnotation, ShapeAnnotation, StampAnnotation, StickyNotesAnnotation, FreeTextAnnotation, InputElement, NavigationPane, PdfViewerBase, TextLayer, ContextMenu$1 as ContextMenu, FontStyle, AnnotationResizerLocation, CursorType, AjaxHandler, Signature, Magnification, Navigation, ThumbnailView, Toolbar$1 as Toolbar, AnnotationToolbar, ToolbarSettings, AjaxRequestSettings, CustomStampItem, AnnotationToolbarSettings, ServerActionSettings, StrikethroughSettings, UnderlineSettings, HighlightSettings, LineSettings, ArrowSettings, RectangleSettings, CircleSettings, ShapeLabelSettings, PolygonSettings, StampSettings, CustomStampSettings, DistanceSettings, PerimeterSettings, AreaSettings, RadiusSettings, VolumeSettings, StickyNotesSettings, MeasurementSettings, FreeTextSettings, AnnotationSelectorSettings, TextSearchColorSettings, HandWrittenSignatureSettings, AnnotationSettings, DocumentTextCollectionSettings, TextDataSettings, RectangleBounds, TileRenderingSettings, ScrollSettings, PdfViewer, BookmarkView, TextSelection, TextSearch, Print, FormFields, Drawing, findActiveElement, findObjectsUnderMouse, findObjectUnderMouse, CalculateLeaderPoints, findElementUnderMouse, insertObject, findTargetShapeElement, findObjects, findActivePage, ActiveElements, getConnectorPoints, getSegmentPath, updateSegmentElement, getSegmentElement, updateDecoratorElement, getDecoratorElement, clipDecorators, clipDecorator, initDistanceLabel, updateDistanceLabel, updateRadiusLabel, initPerimeterLabel, updatePerimeterLabel, removePerimeterLabel, updateCalibrateLabel, getPolygonPath, textElement, initLeaders, initLeader, isPointOverConnector, findNearestPoint, getDecoratorShape, renderAdornerLayer, createSvg, isLineShapes, setElementStype, findPointsLength, findPerimeterLength, getBaseShapeAttributes, getFunction, cloneObject, cloneArray, getInternalProperties, isLeader, PdfBounds, PdfFont, PdfAnnotationBase, ZOrderPageTable, Selector, ToolBase, SelectTool, MoveTool, StampTool, ConnectTool, ResizeTool, NodeDrawingTool, PolygonDrawingTool, LineTool, RotateTool };
42109
42113
  //# sourceMappingURL=ej2-pdfviewer.es5.js.map