@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.
- package/dist/ej2-pdfviewer.umd.min.js +1 -1
- package/dist/ej2-pdfviewer.umd.min.js.map +1 -1
- package/dist/es6/ej2-pdfviewer.es2015.js +329 -319
- package/dist/es6/ej2-pdfviewer.es2015.js.map +1 -1
- package/dist/es6/ej2-pdfviewer.es5.js +328 -324
- package/dist/es6/ej2-pdfviewer.es5.js.map +1 -1
- package/package.json +54 -29
- package/src/pdfviewer/base/ajax-handler.d.ts +1 -0
- package/src/pdfviewer/base/ajax-handler.js +21 -3
- package/src/pdfviewer/base/pdfviewer-base.d.ts +49 -9
- package/src/pdfviewer/base/pdfviewer-base.js +167 -62
- package/src/pdfviewer/base/text-layer.js +0 -3
- package/src/pdfviewer/index.d.ts +0 -1
- package/src/pdfviewer/index.js +0 -1
- package/src/pdfviewer/magnification/magnification.d.ts +24 -0
- package/src/pdfviewer/magnification/magnification.js +131 -32
- package/src/pdfviewer/pdfviewer-model.d.ts +13 -12
- package/src/pdfviewer/pdfviewer.d.ts +11 -23
- package/src/pdfviewer/pdfviewer.js +6 -25
- package/src/pdfviewer/toolbar/toolbar.js +3 -1
- package/src/pdfviewer/tagged-pdf/index.d.ts +0 -4
- package/src/pdfviewer/tagged-pdf/index.js +0 -4
- package/src/pdfviewer/tagged-pdf/tagged-pdf.d.ts +0 -26
- package/src/pdfviewer/tagged-pdf/tagged-pdf.js +0 -195
|
@@ -17787,14 +17787,46 @@ class PdfViewerBase {
|
|
|
17787
17787
|
* @private
|
|
17788
17788
|
*/
|
|
17789
17789
|
this.isReRenderRequired = true;
|
|
17790
|
+
/**
|
|
17791
|
+
* @private
|
|
17792
|
+
*/
|
|
17793
|
+
// eslint-disable-next-line
|
|
17794
|
+
this.isTouchPad = false;
|
|
17795
|
+
/**
|
|
17796
|
+
* @private
|
|
17797
|
+
*/
|
|
17798
|
+
// eslint-disable-next-line
|
|
17799
|
+
this.isMacGestureActive = false;
|
|
17800
|
+
/**
|
|
17801
|
+
* @private
|
|
17802
|
+
*/
|
|
17803
|
+
// eslint-disable-next-line
|
|
17804
|
+
this.macGestureStartScale = 0;
|
|
17805
|
+
/**
|
|
17806
|
+
* @private
|
|
17807
|
+
*/
|
|
17808
|
+
// eslint-disable-next-line
|
|
17809
|
+
this.zoomInterval = 5;
|
|
17810
|
+
/**
|
|
17811
|
+
* @private
|
|
17812
|
+
*/
|
|
17813
|
+
/**
|
|
17814
|
+
* EJ2CORE-813 - This flag is represent current device is 'iPad' or 'iPhone' or'iPod' device.
|
|
17815
|
+
* @private
|
|
17816
|
+
*/
|
|
17817
|
+
// eslint-disable-next-line
|
|
17818
|
+
this.isDeviceiOS = (['iPad Simulator', 'iPhone Simulator', 'iPod Simulator', 'iPad', 'iPhone', 'iPod'].includes(navigator.platform) || (navigator.userAgent.includes("Mac") && "ontouchend" in document));
|
|
17819
|
+
/**
|
|
17820
|
+
* @private
|
|
17821
|
+
*/
|
|
17822
|
+
// eslint-disable-next-line
|
|
17823
|
+
this.isMacSafari = navigator.userAgent.indexOf("Safari") > -1 && navigator.userAgent.indexOf("Chrome") === -1 && !this.isDeviceiOS;
|
|
17790
17824
|
/**
|
|
17791
17825
|
* @private
|
|
17792
17826
|
*/
|
|
17793
17827
|
// tslint:disable-next-line
|
|
17794
17828
|
this.previousContainerHeight = 0;
|
|
17795
17829
|
this.isGotoPageEnabled = false;
|
|
17796
|
-
this.taggedTextHandler = null;
|
|
17797
|
-
this.taggedCollection = [];
|
|
17798
17830
|
this.clearSessionStorage = () => {
|
|
17799
17831
|
let documentId = window.sessionStorage.getItem('hashId');
|
|
17800
17832
|
let documentLiveCount = window.sessionStorage.getItem('documentLiveCount');
|
|
@@ -18065,6 +18097,49 @@ class PdfViewerBase {
|
|
|
18065
18097
|
this.isViewerMouseDown = false;
|
|
18066
18098
|
}
|
|
18067
18099
|
};
|
|
18100
|
+
/**
|
|
18101
|
+
* @param {any} event - The Wheel event.
|
|
18102
|
+
* @returns {void}
|
|
18103
|
+
*/
|
|
18104
|
+
this.detectTouchPad = (event) => {
|
|
18105
|
+
// eslint-disable-next-line max-len
|
|
18106
|
+
this.isTouchPad = event.wheelDeltaY ? (event.wheelDeltaY === (event.deltaY * -3) ? true : Math.abs(event.deltaY) < 60) : (event.deltaMode === 0);
|
|
18107
|
+
};
|
|
18108
|
+
/**
|
|
18109
|
+
* @param {any} event - The Wheel event.
|
|
18110
|
+
* @returns {void}
|
|
18111
|
+
*/
|
|
18112
|
+
this.handleMacGestureStart = (event) => {
|
|
18113
|
+
event.preventDefault();
|
|
18114
|
+
event.stopPropagation();
|
|
18115
|
+
this.macGestureStartScale = this.pdfViewer.magnification.zoomFactor;
|
|
18116
|
+
};
|
|
18117
|
+
/**
|
|
18118
|
+
* @param {any} event - The Wheel event.
|
|
18119
|
+
* @returns {void}
|
|
18120
|
+
*/
|
|
18121
|
+
this.handleMacGestureChange = (event) => {
|
|
18122
|
+
event.preventDefault();
|
|
18123
|
+
event.stopPropagation();
|
|
18124
|
+
let macX = event.clientX;
|
|
18125
|
+
let macY = event.clientY;
|
|
18126
|
+
let scale = Number((this.macGestureStartScale * event.scale).toFixed(2));
|
|
18127
|
+
if (!this.isMacGestureActive) {
|
|
18128
|
+
this.isMacGestureActive = true;
|
|
18129
|
+
this.pdfViewer.magnification.initiateMouseZoom(macX, macY, scale * 100);
|
|
18130
|
+
setTimeout(() => {
|
|
18131
|
+
this.isMacGestureActive = false;
|
|
18132
|
+
}, 70);
|
|
18133
|
+
}
|
|
18134
|
+
};
|
|
18135
|
+
/**
|
|
18136
|
+
* @param {any} event - The Wheel event.
|
|
18137
|
+
* @returns {void}
|
|
18138
|
+
*/
|
|
18139
|
+
this.handleMacGestureEnd = (event) => {
|
|
18140
|
+
event.preventDefault();
|
|
18141
|
+
event.stopPropagation();
|
|
18142
|
+
};
|
|
18068
18143
|
this.viewerContainerOnMouseWheel = (event) => {
|
|
18069
18144
|
this.isViewerMouseWheel = true;
|
|
18070
18145
|
if (this.getRerenderCanvasCreated()) {
|
|
@@ -18078,13 +18153,17 @@ class PdfViewerBase {
|
|
|
18078
18153
|
if (this.pdfViewer.magnification.zoomFactor >= 2) {
|
|
18079
18154
|
zoomDifference = 50;
|
|
18080
18155
|
}
|
|
18156
|
+
if (this.isTouchPad && !this.isMacSafari) {
|
|
18157
|
+
zoomDifference = zoomDifference / this.zoomInterval;
|
|
18158
|
+
}
|
|
18081
18159
|
// eslint-disable-next-line
|
|
18082
18160
|
if (event.wheelDelta > 0) {
|
|
18083
|
-
this.pdfViewer.magnification.
|
|
18161
|
+
this.pdfViewer.magnification.initiateMouseZoom(event.x, event.y, (this.pdfViewer.magnification.zoomFactor * 100) + zoomDifference);
|
|
18084
18162
|
}
|
|
18085
18163
|
else {
|
|
18086
|
-
this.pdfViewer.magnification.
|
|
18164
|
+
this.pdfViewer.magnification.initiateMouseZoom(event.x, event.y, (this.pdfViewer.magnification.zoomFactor * 100) - zoomDifference);
|
|
18087
18165
|
}
|
|
18166
|
+
this.isTouchPad = false;
|
|
18088
18167
|
}
|
|
18089
18168
|
if (this.pdfViewer.magnificationModule) {
|
|
18090
18169
|
this.pdfViewer.magnificationModule.pageRerenderOnMouseWheel();
|
|
@@ -18573,8 +18652,8 @@ class PdfViewerBase {
|
|
|
18573
18652
|
this.previousTime = new Date().getTime();
|
|
18574
18653
|
// tslint:disable-next-line:max-line-length
|
|
18575
18654
|
if (touchPoints.length === 1 && !(event.target.classList.contains('e-pv-touch-select-drop') || event.target.classList.contains('e-pv-touch-ellipse'))) {
|
|
18576
|
-
if (Browser.isDevice && this.pageCount > 0 && !this.isThumb && !(event.target.classList.contains('e-pv-hyperlink'))) {
|
|
18577
|
-
this.handleTaps(touchPoints);
|
|
18655
|
+
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'))) {
|
|
18656
|
+
this.handleTaps(touchPoints, event);
|
|
18578
18657
|
}
|
|
18579
18658
|
else if (!Browser.isDevice) {
|
|
18580
18659
|
this.handleTextBoxTaps(touchPoints);
|
|
@@ -18603,7 +18682,6 @@ class PdfViewerBase {
|
|
|
18603
18682
|
this.pdfViewer.textSelectionModule.initiateTouchSelection(event, this.touchClientX, this.touchClientY);
|
|
18604
18683
|
if (Browser.isDevice) {
|
|
18605
18684
|
clearTimeout(this.singleTapTimer);
|
|
18606
|
-
this.singleTapTimer = null;
|
|
18607
18685
|
this.tapCount = 0;
|
|
18608
18686
|
}
|
|
18609
18687
|
}
|
|
@@ -18853,7 +18931,6 @@ class PdfViewerBase {
|
|
|
18853
18931
|
this.pdfViewer = viewer;
|
|
18854
18932
|
this.navigationPane = new NavigationPane(this.pdfViewer, this);
|
|
18855
18933
|
this.textLayer = new TextLayer(this.pdfViewer, this);
|
|
18856
|
-
this.taggedPdf = new TaggedPDF(this.pdfViewer, this);
|
|
18857
18934
|
this.signatureModule = new Signature(this.pdfViewer, this);
|
|
18858
18935
|
// tslint:disable-next-line:max-line-length
|
|
18859
18936
|
this.isWebkitMobile = /Chrome/.test(navigator.userAgent) || /Google Inc/.test(navigator.vendor) || (navigator.userAgent.indexOf('Safari') !== -1);
|
|
@@ -19679,9 +19756,6 @@ class PdfViewerBase {
|
|
|
19679
19756
|
if (this.renderedPagesList) {
|
|
19680
19757
|
this.renderedPagesList = [];
|
|
19681
19758
|
}
|
|
19682
|
-
if (this.taggedCollection) {
|
|
19683
|
-
this.taggedCollection = [];
|
|
19684
|
-
}
|
|
19685
19759
|
if (this.pageContainer) {
|
|
19686
19760
|
while (this.pageContainer.hasChildNodes()) {
|
|
19687
19761
|
this.pageContainer.removeChild(this.pageContainer.lastChild);
|
|
@@ -20115,7 +20189,16 @@ class PdfViewerBase {
|
|
|
20115
20189
|
}
|
|
20116
20190
|
this.viewerContainer.addEventListener('mousedown', this.viewerContainerOnMousedown);
|
|
20117
20191
|
this.viewerContainer.addEventListener('mouseup', this.viewerContainerOnMouseup);
|
|
20192
|
+
this.viewerContainer.addEventListener("wheel", this.detectTouchPad, false);
|
|
20118
20193
|
this.viewerContainer.addEventListener('wheel', this.viewerContainerOnMouseWheel);
|
|
20194
|
+
if (this.isMacSafari) {
|
|
20195
|
+
window.addEventListener('gesturestart', e => e.preventDefault());
|
|
20196
|
+
window.addEventListener('gesturechange', e => e.preventDefault());
|
|
20197
|
+
window.addEventListener('gestureend', e => e.preventDefault());
|
|
20198
|
+
this.viewerContainer.addEventListener('gesturestart', this.handleMacGestureStart, false);
|
|
20199
|
+
this.viewerContainer.addEventListener('gesturechange', this.handleMacGestureChange, false);
|
|
20200
|
+
this.viewerContainer.addEventListener('gestureend', this.handleMacGestureEnd, false);
|
|
20201
|
+
}
|
|
20119
20202
|
this.viewerContainer.addEventListener('mousemove', this.viewerContainerOnMousemove);
|
|
20120
20203
|
this.viewerContainer.addEventListener('mouseleave', this.viewerContainerOnMouseLeave);
|
|
20121
20204
|
this.viewerContainer.addEventListener('mouseenter', this.viewerContainerOnMouseEnter);
|
|
@@ -20139,6 +20222,12 @@ class PdfViewerBase {
|
|
|
20139
20222
|
}
|
|
20140
20223
|
else {
|
|
20141
20224
|
this.viewerContainer.addEventListener('touchstart', this.viewerContainerOnTouchStart);
|
|
20225
|
+
if (this.isWebkitMobile && this.isDeviceiOS) {
|
|
20226
|
+
// eslint-disable-next-line max-len
|
|
20227
|
+
this.viewerContainer.addEventListener("touchmove", (e) => { if (e.scale !== 1) {
|
|
20228
|
+
e.preventDefault();
|
|
20229
|
+
} }, { passive: false });
|
|
20230
|
+
}
|
|
20142
20231
|
this.viewerContainer.addEventListener('touchmove', this.viewerContainerOnTouchMove);
|
|
20143
20232
|
this.viewerContainer.addEventListener('touchend', this.viewerContainerOnTouchEnd);
|
|
20144
20233
|
this.viewerContainer.addEventListener('touchleave', this.viewerContainerOnTouchEnd);
|
|
@@ -20152,7 +20241,16 @@ class PdfViewerBase {
|
|
|
20152
20241
|
}
|
|
20153
20242
|
this.viewerContainer.removeEventListener('mousedown', this.viewerContainerOnMousedown);
|
|
20154
20243
|
this.viewerContainer.removeEventListener('mouseup', this.viewerContainerOnMouseup);
|
|
20244
|
+
this.viewerContainer.removeEventListener("wheel", this.detectTouchPad, false);
|
|
20155
20245
|
this.viewerContainer.removeEventListener('wheel', this.viewerContainerOnMouseWheel);
|
|
20246
|
+
if (this.isMacSafari) {
|
|
20247
|
+
window.removeEventListener('gesturestart', e => e.preventDefault());
|
|
20248
|
+
window.removeEventListener('gesturechange', e => e.preventDefault());
|
|
20249
|
+
window.removeEventListener('gestureend', e => e.preventDefault());
|
|
20250
|
+
this.viewerContainer.removeEventListener('gesturestart', this.handleMacGestureStart, false);
|
|
20251
|
+
this.viewerContainer.removeEventListener('gesturechange', this.handleMacGestureChange, false);
|
|
20252
|
+
this.viewerContainer.removeEventListener('gestureend', this.handleMacGestureEnd, false);
|
|
20253
|
+
}
|
|
20156
20254
|
this.viewerContainer.removeEventListener('mousemove', this.viewerContainerOnMousemove);
|
|
20157
20255
|
this.viewerContainer.removeEventListener('mouseleave', this.viewerContainerOnMouseLeave);
|
|
20158
20256
|
this.viewerContainer.removeEventListener('mouseenter', this.viewerContainerOnMouseEnter);
|
|
@@ -20173,6 +20271,12 @@ class PdfViewerBase {
|
|
|
20173
20271
|
}
|
|
20174
20272
|
else {
|
|
20175
20273
|
this.viewerContainer.removeEventListener('touchstart', this.viewerContainerOnTouchStart);
|
|
20274
|
+
if (this.isWebkitMobile && this.isDeviceiOS) {
|
|
20275
|
+
// eslint-disable-next-line max-len
|
|
20276
|
+
this.viewerContainer.removeEventListener("touchmove", (e) => { if (e.scale !== 1) {
|
|
20277
|
+
e.preventDefault();
|
|
20278
|
+
} }, false);
|
|
20279
|
+
}
|
|
20176
20280
|
this.viewerContainer.removeEventListener('touchmove', this.viewerContainerOnTouchMove);
|
|
20177
20281
|
this.viewerContainer.removeEventListener('touchend', this.viewerContainerOnTouchEnd);
|
|
20178
20282
|
this.viewerContainer.removeEventListener('touchleave', this.viewerContainerOnTouchEnd);
|
|
@@ -20288,28 +20392,64 @@ class PdfViewerBase {
|
|
|
20288
20392
|
}
|
|
20289
20393
|
this.isViewerContainerDoubleClick = false;
|
|
20290
20394
|
}
|
|
20291
|
-
handleTaps(touchPoints) {
|
|
20292
|
-
|
|
20293
|
-
|
|
20294
|
-
|
|
20295
|
-
|
|
20296
|
-
|
|
20297
|
-
this.
|
|
20395
|
+
handleTaps(touchPoints, event) {
|
|
20396
|
+
//EJ2CORE-813 - Implemented focus removing logic for iOS devices
|
|
20397
|
+
if (this.isDeviceiOS) {
|
|
20398
|
+
const obj = findActiveElement(event, this, this.pdfViewer);
|
|
20399
|
+
// eslint-disable-next-line
|
|
20400
|
+
let isRemoveFocus = !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);
|
|
20401
|
+
if (!this.singleTapTimer) {
|
|
20402
|
+
this.singleTapTimer = setTimeout(() => {
|
|
20403
|
+
if (isRemoveFocus) {
|
|
20404
|
+
this.pdfViewer.clearSelection(this.pdfViewer.selectedItems.annotations[0].pageIndex);
|
|
20405
|
+
this.focusViewerContainer();
|
|
20406
|
+
}
|
|
20407
|
+
this.onSingleTap(touchPoints);
|
|
20408
|
+
// eslint-disable-next-line
|
|
20409
|
+
}, 300);
|
|
20410
|
+
this.tapCount++;
|
|
20411
|
+
}
|
|
20412
|
+
else {
|
|
20413
|
+
if (this.pdfViewer.enablePinchZoom) {
|
|
20414
|
+
this.tapCount++;
|
|
20415
|
+
clearTimeout(this.singleTapTimer);
|
|
20416
|
+
this.singleTapTimer = null;
|
|
20417
|
+
this.onDoubleTap(touchPoints);
|
|
20418
|
+
}
|
|
20419
|
+
}
|
|
20298
20420
|
}
|
|
20299
20421
|
else {
|
|
20300
|
-
if (this.
|
|
20422
|
+
if (!this.singleTapTimer) {
|
|
20423
|
+
this.singleTapTimer = setTimeout(() => {
|
|
20424
|
+
this.onSingleTap(touchPoints);
|
|
20425
|
+
// eslint-disable-next-line
|
|
20426
|
+
}, 300);
|
|
20301
20427
|
this.tapCount++;
|
|
20302
|
-
|
|
20303
|
-
|
|
20304
|
-
this.
|
|
20428
|
+
}
|
|
20429
|
+
else {
|
|
20430
|
+
if (this.pdfViewer.enablePinchZoom) {
|
|
20431
|
+
this.tapCount++;
|
|
20432
|
+
clearTimeout(this.singleTapTimer);
|
|
20433
|
+
this.singleTapTimer = null;
|
|
20434
|
+
this.onDoubleTap(touchPoints);
|
|
20435
|
+
}
|
|
20305
20436
|
}
|
|
20306
20437
|
}
|
|
20307
20438
|
}
|
|
20308
20439
|
handleTextBoxTaps(touchPoints) {
|
|
20309
|
-
setTimeout(() => {
|
|
20440
|
+
setTimeout(() => {
|
|
20441
|
+
this.inputTapCount = 0;
|
|
20442
|
+
}, 300);
|
|
20310
20443
|
this.inputTapCount++;
|
|
20311
|
-
|
|
20312
|
-
|
|
20444
|
+
if (this.isDeviceiOS) {
|
|
20445
|
+
// eslint-disable-next-line
|
|
20446
|
+
this.onTextBoxDoubleTap(touchPoints);
|
|
20447
|
+
}
|
|
20448
|
+
else {
|
|
20449
|
+
let timer = setTimeout(() => {
|
|
20450
|
+
this.onTextBoxDoubleTap(touchPoints);
|
|
20451
|
+
}, 200);
|
|
20452
|
+
}
|
|
20313
20453
|
if (this.inputTapCount > 2) {
|
|
20314
20454
|
this.inputTapCount = 0;
|
|
20315
20455
|
}
|
|
@@ -20408,7 +20548,7 @@ class PdfViewerBase {
|
|
|
20408
20548
|
if (this.pdfViewer.textSelectionModule) {
|
|
20409
20549
|
// tslint:disable-next-line:max-line-length
|
|
20410
20550
|
if (!this.isPanMode && this.pdfViewer.enableTextSelection && !this.isTextSelectionDisabled && this.getSelectTextMarkupCurrentPage() == null) {
|
|
20411
|
-
if (!(this.isWebkitMobile && Browser.isDevice)) {
|
|
20551
|
+
if (!(this.isWebkitMobile && (Browser.isDevice || (typeof navigator !== 'undefined' && navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1 && Browser.isTouch === true)))) {
|
|
20412
20552
|
event.preventDefault();
|
|
20413
20553
|
event.stopPropagation();
|
|
20414
20554
|
}
|
|
@@ -20850,14 +20990,6 @@ class PdfViewerBase {
|
|
|
20850
20990
|
if (this.pdfViewer.textSelectionModule && !this.isTextSelectionDisabled) {
|
|
20851
20991
|
this.pdfViewer.textSelectionModule.applySelectionRangeOnScroll(pageIndex);
|
|
20852
20992
|
}
|
|
20853
|
-
if (this.pdfViewer.taggedPDFModule && this.pdfViewer.enableTaggedPDF) {
|
|
20854
|
-
if (this.taggedCollection[pageIndex.toString()]) {
|
|
20855
|
-
this.renderTaggedTextContentsFromServer(pageIndex, this.taggedCollection[pageIndex.toString()]);
|
|
20856
|
-
}
|
|
20857
|
-
else {
|
|
20858
|
-
this.createRequestForTaggedText(pageIndex);
|
|
20859
|
-
}
|
|
20860
|
-
}
|
|
20861
20993
|
if (this.documentAnnotationCollections) {
|
|
20862
20994
|
let isAnnotationAdded = false;
|
|
20863
20995
|
for (let i = 0; i < this.annotationRenderredList.length; i++) {
|
|
@@ -21052,33 +21184,6 @@ class PdfViewerBase {
|
|
|
21052
21184
|
}
|
|
21053
21185
|
}
|
|
21054
21186
|
}
|
|
21055
|
-
renderTaggedTextContentsFromServer(pageIndex, taggedTextResponse) {
|
|
21056
|
-
this.taggedPdf.renderTaggedTextContentsFromServer(pageIndex, taggedTextResponse);
|
|
21057
|
-
}
|
|
21058
|
-
createRequestForTaggedText(pageIndex) {
|
|
21059
|
-
let jsonObject;
|
|
21060
|
-
let proxy = this;
|
|
21061
|
-
jsonObject = { action: 'RenderTaggedContent', elementId: this.pdfViewer.element.id, hashId: this.hashId, uniqueId: this.documentId, pageIndex: pageIndex };
|
|
21062
|
-
if (this.jsonDocumentId) {
|
|
21063
|
-
jsonObject.document = this.jsonDocumentId;
|
|
21064
|
-
}
|
|
21065
|
-
var url = this.pdfViewer.serviceUrl + '/' + "RenderTaggedContent";
|
|
21066
|
-
this.taggedTextHandler = new AjaxHandler(this.pdfViewer);
|
|
21067
|
-
this.taggedTextHandler.url = url;
|
|
21068
|
-
this.taggedTextHandler.mode = true;
|
|
21069
|
-
this.taggedTextHandler.responseType = 'text';
|
|
21070
|
-
this.taggedTextHandler.send(jsonObject);
|
|
21071
|
-
this.taggedTextHandler.onSuccess = function (result) {
|
|
21072
|
-
var data = JSON.parse(result.data);
|
|
21073
|
-
let pageData = data.filter((item) => (item.PageNumber).toString() === pageIndex.toString());
|
|
21074
|
-
proxy.taggedCollection[pageIndex.toString()] = pageData;
|
|
21075
|
-
proxy.renderTaggedTextContentsFromServer(pageIndex, pageData);
|
|
21076
|
-
};
|
|
21077
|
-
this.taggedTextHandler.onFailure = function (result) {
|
|
21078
|
-
console.log("error");
|
|
21079
|
-
};
|
|
21080
|
-
}
|
|
21081
|
-
;
|
|
21082
21187
|
renderPageContainer(pageNumber, pageWidth, pageHeight, topValue) {
|
|
21083
21188
|
// tslint:disable-next-line:max-line-length
|
|
21084
21189
|
let pageDiv = createElement('div', { id: this.pdfViewer.element.id + '_pageDiv_' + pageNumber, className: 'e-pv-page-div', attrs: { 'tabindex': '0' } });
|
|
@@ -24370,9 +24475,6 @@ class TextLayer {
|
|
|
24370
24475
|
textLayer = createElement('div', { id: this.pdfViewer.element.id + '_textLayer_' + pageNumber, className: 'e-pv-text-layer' });
|
|
24371
24476
|
textLayer.style.width = pageWidth + 'px';
|
|
24372
24477
|
textLayer.style.height = pageHeight + 'px';
|
|
24373
|
-
if (this.pdfViewer.taggedPDFModule && this.pdfViewer.enableTaggedPDF) {
|
|
24374
|
-
textLayer.setAttribute('aria-hidden', 'true');
|
|
24375
|
-
}
|
|
24376
24478
|
pageDiv.appendChild(textLayer);
|
|
24377
24479
|
}
|
|
24378
24480
|
this.pdfViewerBase.applyElementStyles(textLayer, pageNumber);
|
|
@@ -25332,9 +25434,11 @@ class AjaxHandler {
|
|
|
25332
25434
|
* @private
|
|
25333
25435
|
*/
|
|
25334
25436
|
this.contentType = 'application/json;charset=UTF-8';
|
|
25437
|
+
this.retryTimeout = 0;
|
|
25335
25438
|
this.pdfViewer = pdfviewer;
|
|
25336
25439
|
this.retryCount = pdfviewer.retryCount;
|
|
25337
25440
|
this.retryStatusCodes = pdfviewer.retryStatusCodes;
|
|
25441
|
+
this.retryTimeout = 1000 * pdfviewer.retryTimeout;
|
|
25338
25442
|
}
|
|
25339
25443
|
/**
|
|
25340
25444
|
* Send the request to server
|
|
@@ -25343,6 +25447,7 @@ class AjaxHandler {
|
|
|
25343
25447
|
*/
|
|
25344
25448
|
send(jsonObj) {
|
|
25345
25449
|
this.httpRequest = new XMLHttpRequest();
|
|
25450
|
+
this.httpRequest.timeout = this.retryTimeout;
|
|
25346
25451
|
if (!this.mode) {
|
|
25347
25452
|
setTimeout(() => { this.sendRequest(jsonObj); });
|
|
25348
25453
|
}
|
|
@@ -25358,7 +25463,22 @@ class AjaxHandler {
|
|
|
25358
25463
|
this.retryCount = 0;
|
|
25359
25464
|
}
|
|
25360
25465
|
if (this.retryCount > 0) {
|
|
25361
|
-
isSkip = this.resendRequest(this, jsonObj);
|
|
25466
|
+
isSkip = this.resendRequest(this, jsonObj, false);
|
|
25467
|
+
}
|
|
25468
|
+
if (!isSkip) {
|
|
25469
|
+
this.stateChange(this);
|
|
25470
|
+
}
|
|
25471
|
+
};
|
|
25472
|
+
this.httpRequest.ontimeout = () => {
|
|
25473
|
+
let isSkip = false;
|
|
25474
|
+
// tslint:disable-next-line
|
|
25475
|
+
let viewerBase = this.pdfViewer.viewerBase;
|
|
25476
|
+
if (viewerBase && viewerBase.isPasswordAvailable && viewerBase.passwordData === '') {
|
|
25477
|
+
isSkip = true;
|
|
25478
|
+
this.retryCount = 0;
|
|
25479
|
+
}
|
|
25480
|
+
if (this.retryCount > 0) {
|
|
25481
|
+
isSkip = this.resendRequest(this, jsonObj, true);
|
|
25362
25482
|
}
|
|
25363
25483
|
if (!isSkip) {
|
|
25364
25484
|
this.stateChange(this);
|
|
@@ -25367,7 +25487,7 @@ class AjaxHandler {
|
|
|
25367
25487
|
this.httpRequest.onerror = () => { this.error(this); };
|
|
25368
25488
|
}
|
|
25369
25489
|
// tslint:disable-next-line
|
|
25370
|
-
resendRequest(proxy, jsonObj) {
|
|
25490
|
+
resendRequest(proxy, jsonObj, isTimeout) {
|
|
25371
25491
|
let isSkip = false;
|
|
25372
25492
|
let status = proxy.httpRequest.status;
|
|
25373
25493
|
let statusString = this.retryStatusCodes.indexOf(status) !== -1;
|
|
@@ -25394,7 +25514,7 @@ class AjaxHandler {
|
|
|
25394
25514
|
}
|
|
25395
25515
|
}
|
|
25396
25516
|
}
|
|
25397
|
-
if (statusString || isSkip) {
|
|
25517
|
+
if (statusString || isSkip || isTimeout) {
|
|
25398
25518
|
isSkip = true;
|
|
25399
25519
|
this.retryCount--;
|
|
25400
25520
|
proxy.send(jsonObj);
|
|
@@ -26043,7 +26163,7 @@ class Magnification {
|
|
|
26043
26163
|
this.scrollWidth = 25;
|
|
26044
26164
|
this.zoomPercentages = [10, 25, 50, 75, 100, 125, 150, 200, 400];
|
|
26045
26165
|
this.isNotPredefinedZoom = false;
|
|
26046
|
-
this.pinchStep = 0
|
|
26166
|
+
this.pinchStep = 0;
|
|
26047
26167
|
this.reRenderPageNumber = 0;
|
|
26048
26168
|
// tslint:disable-next-line
|
|
26049
26169
|
this.magnifyPageRerenderTimer = null;
|
|
@@ -26053,6 +26173,8 @@ class Magnification {
|
|
|
26053
26173
|
this.rerenderInterval = null;
|
|
26054
26174
|
this.touchCenterX = 0;
|
|
26055
26175
|
this.touchCenterY = 0;
|
|
26176
|
+
this.mouseCenterX = 0;
|
|
26177
|
+
this.mouseCenterY = 0;
|
|
26056
26178
|
this.pageRerenderCount = 0;
|
|
26057
26179
|
this.imageObjects = [];
|
|
26058
26180
|
this.topValue = 0;
|
|
@@ -26089,6 +26211,10 @@ class Magnification {
|
|
|
26089
26211
|
* @private
|
|
26090
26212
|
*/
|
|
26091
26213
|
this.isAutoZoom = false;
|
|
26214
|
+
/**
|
|
26215
|
+
* @private
|
|
26216
|
+
*/
|
|
26217
|
+
this.isDoubleTapZoom = false;
|
|
26092
26218
|
this.isWebkitMobile = false;
|
|
26093
26219
|
this.pdfViewer = pdfViewer;
|
|
26094
26220
|
this.pdfViewerBase = viewerBase;
|
|
@@ -26102,11 +26228,13 @@ class Magnification {
|
|
|
26102
26228
|
* @returns void
|
|
26103
26229
|
*/
|
|
26104
26230
|
zoomTo(zoomValue) {
|
|
26105
|
-
|
|
26106
|
-
|
|
26231
|
+
let MaximumZoomPercentage = 400;
|
|
26232
|
+
let MinmumZoomPercentage = 10;
|
|
26233
|
+
if (zoomValue < MinmumZoomPercentage) {
|
|
26234
|
+
zoomValue = MinmumZoomPercentage;
|
|
26107
26235
|
}
|
|
26108
|
-
else if (zoomValue >
|
|
26109
|
-
zoomValue =
|
|
26236
|
+
else if (zoomValue > MaximumZoomPercentage) {
|
|
26237
|
+
zoomValue = MaximumZoomPercentage;
|
|
26110
26238
|
}
|
|
26111
26239
|
this.fitType = null;
|
|
26112
26240
|
this.isNotPredefinedZoom = false;
|
|
@@ -26246,6 +26374,16 @@ class Magnification {
|
|
|
26246
26374
|
return parseInt(((viewerHeight / highestHeight) * 100).toString());
|
|
26247
26375
|
}
|
|
26248
26376
|
}
|
|
26377
|
+
/**
|
|
26378
|
+
* Initiating cursor based zoom.
|
|
26379
|
+
* @private
|
|
26380
|
+
*/
|
|
26381
|
+
initiateMouseZoom(pointX, pointY, zoomValue) {
|
|
26382
|
+
let pointInViewer = this.positionInViewer(pointX, pointY);
|
|
26383
|
+
this.mouseCenterX = pointInViewer.x;
|
|
26384
|
+
this.mouseCenterY = pointInViewer.y;
|
|
26385
|
+
this.zoomTo(zoomValue);
|
|
26386
|
+
}
|
|
26249
26387
|
/**
|
|
26250
26388
|
* Performs pinch in operation
|
|
26251
26389
|
*/
|
|
@@ -26255,8 +26393,11 @@ class Magnification {
|
|
|
26255
26393
|
if (temporaryZoomFactor < 4 && temporaryZoomFactor > 2) {
|
|
26256
26394
|
temporaryZoomFactor = this.zoomFactor - this.pinchStep;
|
|
26257
26395
|
}
|
|
26258
|
-
if (temporaryZoomFactor
|
|
26259
|
-
temporaryZoomFactor =
|
|
26396
|
+
if (temporaryZoomFactor <= 1.5) {
|
|
26397
|
+
temporaryZoomFactor = this.zoomFactor - (this.pinchStep / 1.5);
|
|
26398
|
+
}
|
|
26399
|
+
if (temporaryZoomFactor < 0.25) {
|
|
26400
|
+
temporaryZoomFactor = 0.25;
|
|
26260
26401
|
}
|
|
26261
26402
|
this.isPinchZoomed = true;
|
|
26262
26403
|
this.onZoomChanged(temporaryZoomFactor * 100);
|
|
@@ -26276,8 +26417,8 @@ class Magnification {
|
|
|
26276
26417
|
this.fitType = null;
|
|
26277
26418
|
let temporaryZoomFactor = this.zoomFactor + this.pinchStep;
|
|
26278
26419
|
if (Browser.isDevice) {
|
|
26279
|
-
if (temporaryZoomFactor >
|
|
26280
|
-
temporaryZoomFactor =
|
|
26420
|
+
if (temporaryZoomFactor > 4) {
|
|
26421
|
+
temporaryZoomFactor = 4;
|
|
26281
26422
|
}
|
|
26282
26423
|
}
|
|
26283
26424
|
else {
|
|
@@ -26375,8 +26516,9 @@ class Magnification {
|
|
|
26375
26516
|
* @private
|
|
26376
26517
|
*/
|
|
26377
26518
|
setTouchPoints(clientX, clientY) {
|
|
26378
|
-
|
|
26379
|
-
this.
|
|
26519
|
+
let pointInViewer = this.positionInViewer(clientX, clientY);
|
|
26520
|
+
this.touchCenterX = pointInViewer.x;
|
|
26521
|
+
this.touchCenterY = pointInViewer.y;
|
|
26380
26522
|
}
|
|
26381
26523
|
/**
|
|
26382
26524
|
* @private
|
|
@@ -26385,8 +26527,9 @@ class Magnification {
|
|
|
26385
26527
|
this.isPinchScrolled = false;
|
|
26386
26528
|
this.isMagnified = false;
|
|
26387
26529
|
this.reRenderPageNumber = this.pdfViewerBase.currentPageNumber;
|
|
26388
|
-
|
|
26389
|
-
this.
|
|
26530
|
+
let pointInViewer = this.positionInViewer((pointX1 + pointX2) / 2, (pointY1 + pointY2) / 2);
|
|
26531
|
+
this.touchCenterX = pointInViewer.x;
|
|
26532
|
+
this.touchCenterY = pointInViewer.y;
|
|
26390
26533
|
this.zoomOverPages(pointX1, pointY1, pointX2, pointY2);
|
|
26391
26534
|
}
|
|
26392
26535
|
magnifyPages() {
|
|
@@ -26397,7 +26540,7 @@ class Magnification {
|
|
|
26397
26540
|
if (!this.pdfViewerBase.documentLoaded) {
|
|
26398
26541
|
this.isPagesZoomed = true;
|
|
26399
26542
|
}
|
|
26400
|
-
|
|
26543
|
+
const scrollValue = this.pdfViewerBase.viewerContainer.scrollTop;
|
|
26401
26544
|
if (this.pdfViewer.textSelectionModule) {
|
|
26402
26545
|
this.pdfViewer.textSelectionModule.maintainSelectionOnZoom(false, true);
|
|
26403
26546
|
}
|
|
@@ -26406,6 +26549,7 @@ class Magnification {
|
|
|
26406
26549
|
}
|
|
26407
26550
|
this.updatePageLocation();
|
|
26408
26551
|
this.resizeCanvas(this.reRenderPageNumber);
|
|
26552
|
+
this.calculateScrollValuesOnMouse(scrollValue);
|
|
26409
26553
|
if (this.pdfViewer.textSelectionModule) {
|
|
26410
26554
|
this.pdfViewer.textSelectionModule.resizeTouchElements();
|
|
26411
26555
|
}
|
|
@@ -26421,7 +26565,6 @@ class Magnification {
|
|
|
26421
26565
|
let proxy = this;
|
|
26422
26566
|
this.pdfViewerBase.renderedPagesList = [];
|
|
26423
26567
|
this.pdfViewerBase.pinchZoomStorage = [];
|
|
26424
|
-
this.pdfViewerBase.viewerContainer.scrollTop = scrollValue;
|
|
26425
26568
|
if (!this.pdfViewerBase.documentLoaded) {
|
|
26426
26569
|
this.magnifyPageRerenderTimer = setTimeout(() => { proxy.rerenderMagnifiedPages(); }, 800);
|
|
26427
26570
|
}
|
|
@@ -26530,19 +26673,63 @@ class Magnification {
|
|
|
26530
26673
|
let pageIndex = this.pdfViewerBase.currentPageNumber - 1;
|
|
26531
26674
|
let currentPageCanvas = this.pdfViewerBase.getElement('_pageDiv_' + pageIndex);
|
|
26532
26675
|
if (currentPageCanvas) {
|
|
26533
|
-
let
|
|
26676
|
+
let pointInViewer;
|
|
26677
|
+
const currentPageBounds = currentPageCanvas.getBoundingClientRect();
|
|
26678
|
+
if (this.pdfViewer.enableRtl && !this.isDoubleTapZoom) {
|
|
26679
|
+
pointInViewer = this.positionInViewer(currentPageBounds.right, currentPageBounds.top);
|
|
26680
|
+
}
|
|
26681
|
+
else {
|
|
26682
|
+
pointInViewer = this.positionInViewer(currentPageBounds.left, currentPageBounds.top);
|
|
26683
|
+
}
|
|
26684
|
+
let currentPageBoundsLeft = pointInViewer.x;
|
|
26685
|
+
let currentPageBoundsTop = pointInViewer.y;
|
|
26534
26686
|
// update scroll top for the viewer container based on pinch zoom factor
|
|
26535
|
-
|
|
26536
|
-
|
|
26537
|
-
//
|
|
26538
|
-
|
|
26539
|
-
//
|
|
26687
|
+
const previousPageTop = (currentPageBoundsTop) * this.previousZoomFactor;
|
|
26688
|
+
const canvasPreviousY = scrollValue + this.touchCenterY;
|
|
26689
|
+
// eslint-disable-next-line max-len
|
|
26690
|
+
const canvasCurrentY = (currentPageBoundsTop) * this.zoomFactor + ((canvasPreviousY - previousPageTop) < 0 ? canvasPreviousY - previousPageTop : (canvasPreviousY -
|
|
26691
|
+
// eslint-disable-next-line max-len
|
|
26540
26692
|
previousPageTop) * (this.zoomFactor / this.previousZoomFactor));
|
|
26541
|
-
this.pdfViewerBase.
|
|
26693
|
+
let pageGapValue = this.zoomFactor - this.previousZoomFactor > 0 ? -this.pdfViewerBase.pageGap * (this.zoomFactor / this.previousZoomFactor) : this.pdfViewerBase.pageGap * (this.previousZoomFactor / this.zoomFactor);
|
|
26694
|
+
this.pdfViewerBase.viewerContainer.scrollTop = canvasCurrentY - this.touchCenterY + pageGapValue / this.pdfViewerBase.zoomInterval;
|
|
26542
26695
|
// update scroll left for the viewer container based on pinch zoom factor
|
|
26543
|
-
|
|
26544
|
-
|
|
26545
|
-
|
|
26696
|
+
const previousWidthFactor = (currentPageBounds.width * this.previousZoomFactor) / currentPageBounds.width;
|
|
26697
|
+
const scaleCorrectionFactor = this.zoomFactor / previousWidthFactor - 1;
|
|
26698
|
+
const scrollX = this.touchCenterX - currentPageBoundsLeft;
|
|
26699
|
+
this.pdfViewerBase.viewerContainer.scrollLeft += scrollX * scaleCorrectionFactor;
|
|
26700
|
+
}
|
|
26701
|
+
}
|
|
26702
|
+
calculateScrollValuesOnMouse(scrollValue) {
|
|
26703
|
+
const pageIndex = this.pdfViewerBase.currentPageNumber - 1;
|
|
26704
|
+
const currentPageCanvas = this.pdfViewerBase.getElement('_pageDiv_' + pageIndex);
|
|
26705
|
+
if (currentPageCanvas) {
|
|
26706
|
+
let pointInViewer;
|
|
26707
|
+
const currentPageBounds = currentPageCanvas.getBoundingClientRect();
|
|
26708
|
+
if (this.pdfViewer.enableRtl) {
|
|
26709
|
+
pointInViewer = this.positionInViewer(currentPageBounds.right, currentPageBounds.top);
|
|
26710
|
+
}
|
|
26711
|
+
else {
|
|
26712
|
+
pointInViewer = this.positionInViewer(currentPageBounds.left, currentPageBounds.top);
|
|
26713
|
+
}
|
|
26714
|
+
let currentPageBoundsLeft = pointInViewer.x;
|
|
26715
|
+
let currentPageBoundsTop = pointInViewer.y;
|
|
26716
|
+
// update scroll top for the viewer container based on mouse zoom factor
|
|
26717
|
+
const previousPageTop = (currentPageBoundsTop) * this.previousZoomFactor;
|
|
26718
|
+
const canvasPreviousY = scrollValue + this.mouseCenterY;
|
|
26719
|
+
// eslint-disable-next-line max-len
|
|
26720
|
+
const canvasCurrentY = (currentPageBoundsTop) * this.zoomFactor + ((canvasPreviousY - previousPageTop) < 0 ? canvasPreviousY - previousPageTop : (canvasPreviousY -
|
|
26721
|
+
// eslint-disable-next-line max-len
|
|
26722
|
+
previousPageTop) * (this.zoomFactor / this.previousZoomFactor));
|
|
26723
|
+
// eslint-disable-next-line max-len
|
|
26724
|
+
let pageGapValue = this.zoomFactor - this.previousZoomFactor > 0 ? -this.pdfViewerBase.pageGap * (this.zoomFactor / this.previousZoomFactor) : this.pdfViewerBase.pageGap * (this.previousZoomFactor / this.zoomFactor);
|
|
26725
|
+
if (this.pdfViewerBase.isTouchPad && !this.pdfViewerBase.isMacSafari) {
|
|
26726
|
+
pageGapValue = pageGapValue / this.pdfViewerBase.zoomInterval;
|
|
26727
|
+
}
|
|
26728
|
+
this.pdfViewerBase.viewerContainer.scrollTop = canvasCurrentY - this.mouseCenterY + pageGapValue;
|
|
26729
|
+
// update scroll left for the viewer container based on mouse zoom factor
|
|
26730
|
+
const previousWidthFactor = (currentPageBounds.width * this.previousZoomFactor) / currentPageBounds.width;
|
|
26731
|
+
const scaleCorrectionFactor = this.zoomFactor / previousWidthFactor - 1;
|
|
26732
|
+
const scrollX = this.mouseCenterX - currentPageBoundsLeft;
|
|
26546
26733
|
this.pdfViewerBase.viewerContainer.scrollLeft += scrollX * scaleCorrectionFactor;
|
|
26547
26734
|
}
|
|
26548
26735
|
}
|
|
@@ -26905,9 +27092,11 @@ class Magnification {
|
|
|
26905
27092
|
let currentDifference = Math.sqrt(Math.pow((pointX1 - pointX2), 2) + Math.pow((pointY1 - pointY2), 2));
|
|
26906
27093
|
if (this.previousTouchDifference > -1) {
|
|
26907
27094
|
if (currentDifference > this.previousTouchDifference) {
|
|
27095
|
+
this.pinchStep = this.getPinchStep(currentDifference, this.previousTouchDifference);
|
|
26908
27096
|
this.pinchOut();
|
|
26909
27097
|
}
|
|
26910
27098
|
else if (currentDifference < this.previousTouchDifference) {
|
|
27099
|
+
this.pinchStep = this.getPinchStep(this.previousTouchDifference, currentDifference);
|
|
26911
27100
|
this.pinchIn();
|
|
26912
27101
|
}
|
|
26913
27102
|
}
|
|
@@ -27020,19 +27209,23 @@ class Magnification {
|
|
|
27020
27209
|
this.pdfViewer.toolbarModule.showToolbar(false);
|
|
27021
27210
|
}
|
|
27022
27211
|
let scrollValue = this.pdfViewerBase.viewerContainer.scrollTop;
|
|
27023
|
-
if (!this.
|
|
27024
|
-
|
|
27025
|
-
|
|
27212
|
+
if (!this.pdfViewer.selectedItems.annotations[0]) {
|
|
27213
|
+
this.isDoubleTapZoom = true;
|
|
27214
|
+
if (!this.isTapToFitZoom) {
|
|
27215
|
+
if (this.zoomFactor < 2) {
|
|
27216
|
+
this.zoomTo(200);
|
|
27217
|
+
}
|
|
27218
|
+
else {
|
|
27219
|
+
this.fitToWidth();
|
|
27220
|
+
}
|
|
27026
27221
|
}
|
|
27027
27222
|
else {
|
|
27028
27223
|
this.fitToWidth();
|
|
27029
27224
|
}
|
|
27225
|
+
this.calculateScrollValues(scrollValue);
|
|
27226
|
+
this.isTapToFitZoom = !this.isTapToFitZoom;
|
|
27227
|
+
this.isDoubleTapZoom = false;
|
|
27030
27228
|
}
|
|
27031
|
-
else {
|
|
27032
|
-
this.fitToWidth();
|
|
27033
|
-
}
|
|
27034
|
-
this.calculateScrollValues(scrollValue);
|
|
27035
|
-
this.isTapToFitZoom = !this.isTapToFitZoom;
|
|
27036
27229
|
}
|
|
27037
27230
|
downwardScrollFitPage(currentPageIndex) {
|
|
27038
27231
|
if (currentPageIndex !== (this.pdfViewerBase.pageCount - 1)) {
|
|
@@ -27067,6 +27260,32 @@ class Magnification {
|
|
|
27067
27260
|
getModuleName() {
|
|
27068
27261
|
return 'Magnification';
|
|
27069
27262
|
}
|
|
27263
|
+
/**
|
|
27264
|
+
* Returns the pinch step value.
|
|
27265
|
+
* @param higherValue
|
|
27266
|
+
* @param lowerValue
|
|
27267
|
+
*/
|
|
27268
|
+
getPinchStep(higherValue, lowerValue) {
|
|
27269
|
+
let defaultPinchStep = 0.02; // Default pinch step value.
|
|
27270
|
+
let higherPinchStep = 1; // higher pinch step value.
|
|
27271
|
+
let pinchstep = (higherValue - lowerValue) / 100;
|
|
27272
|
+
if (pinchstep < defaultPinchStep) {
|
|
27273
|
+
pinchstep = defaultPinchStep;
|
|
27274
|
+
}
|
|
27275
|
+
else if (pinchstep > higherPinchStep) {
|
|
27276
|
+
pinchstep = 0.1; // set the pinch step as 0.1 if the pinch reaches the higher pinch step value.
|
|
27277
|
+
}
|
|
27278
|
+
return pinchstep;
|
|
27279
|
+
}
|
|
27280
|
+
/**
|
|
27281
|
+
* Returns Point value respect to Main container.
|
|
27282
|
+
* @param pointX
|
|
27283
|
+
* @param pointY
|
|
27284
|
+
*/
|
|
27285
|
+
positionInViewer(pointX, pointY) {
|
|
27286
|
+
let mainRect = this.pdfViewerBase.mainContainer.getBoundingClientRect();
|
|
27287
|
+
return { x: pointX - mainRect.left, y: pointY - mainRect.top };
|
|
27288
|
+
}
|
|
27070
27289
|
}
|
|
27071
27290
|
|
|
27072
27291
|
/**
|
|
@@ -27812,7 +28031,9 @@ class Toolbar$1 {
|
|
|
27812
28031
|
showToolbar(enableToolbar) {
|
|
27813
28032
|
let toolbar = this.toolbarElement;
|
|
27814
28033
|
if (enableToolbar) {
|
|
27815
|
-
toolbar
|
|
28034
|
+
if (toolbar) {
|
|
28035
|
+
toolbar.style.display = 'block';
|
|
28036
|
+
}
|
|
27816
28037
|
if (Browser.isDevice && this.pdfViewer.toolbarModule && this.pdfViewer.toolbarModule.annotationToolbarModule) {
|
|
27817
28038
|
this.pdfViewer.toolbarModule.annotationToolbarModule.hideMobileAnnotationToolbar();
|
|
27818
28039
|
}
|
|
@@ -35455,16 +35676,6 @@ let PdfViewer = class PdfViewer extends Component {
|
|
|
35455
35676
|
get textSearch() {
|
|
35456
35677
|
return this.textSearchModule;
|
|
35457
35678
|
}
|
|
35458
|
-
/**
|
|
35459
|
-
* Gets the tagged layer object of the pdf viewer.
|
|
35460
|
-
*
|
|
35461
|
-
* @asptype TaggedPDF
|
|
35462
|
-
* @blazorType TaggedPDF
|
|
35463
|
-
* @returns { TaggedPDF }
|
|
35464
|
-
*/
|
|
35465
|
-
get taggedPdf() {
|
|
35466
|
-
return this.taggedPDFModule;
|
|
35467
|
-
}
|
|
35468
35679
|
/**
|
|
35469
35680
|
* Gets the toolbar object of the pdf viewer.
|
|
35470
35681
|
* @asptype Toolbar
|
|
@@ -35681,11 +35892,6 @@ let PdfViewer = class PdfViewer extends Component {
|
|
|
35681
35892
|
member: 'FormFields', args: [this, this.viewerBase]
|
|
35682
35893
|
});
|
|
35683
35894
|
}
|
|
35684
|
-
if (this.enableTaggedPDF) {
|
|
35685
|
-
modules.push({
|
|
35686
|
-
member: 'TaggedPDF', args: [this, this.viewerBase]
|
|
35687
|
-
});
|
|
35688
|
-
}
|
|
35689
35895
|
return modules;
|
|
35690
35896
|
}
|
|
35691
35897
|
/**
|
|
@@ -36534,15 +36740,15 @@ __decorate$2([
|
|
|
36534
36740
|
__decorate$2([
|
|
36535
36741
|
Property(true)
|
|
36536
36742
|
], PdfViewer.prototype, "enableZoomOptimization", void 0);
|
|
36537
|
-
__decorate$2([
|
|
36538
|
-
Property(false)
|
|
36539
|
-
], PdfViewer.prototype, "isExtractText", void 0);
|
|
36540
|
-
__decorate$2([
|
|
36541
|
-
Property(true)
|
|
36542
|
-
], PdfViewer.prototype, "enableTaggedPDF", void 0);
|
|
36543
36743
|
__decorate$2([
|
|
36544
36744
|
Property([500])
|
|
36545
36745
|
], PdfViewer.prototype, "retryStatusCodes", void 0);
|
|
36746
|
+
__decorate$2([
|
|
36747
|
+
Property(0)
|
|
36748
|
+
], PdfViewer.prototype, "retryTimeout", void 0);
|
|
36749
|
+
__decorate$2([
|
|
36750
|
+
Property(false)
|
|
36751
|
+
], PdfViewer.prototype, "isExtractText", void 0);
|
|
36546
36752
|
__decorate$2([
|
|
36547
36753
|
Property({ showTooltip: true, toolbarItems: ['OpenOption', 'UndoRedoTool', 'PageNavigationTool', 'MagnificationTool', 'PanTool', 'SelectionTool', 'CommentTool', 'AnnotationEditTool', 'FreeTextAnnotationOption', 'InkAnnotationOption', 'ShapeAnnotationOption', 'StampAnnotation', 'SignatureOption', 'SearchOption', 'PrintOption', 'DownloadOption'] })
|
|
36548
36754
|
], PdfViewer.prototype, "toolbarSettings", void 0);
|
|
@@ -41386,202 +41592,6 @@ class FormFields {
|
|
|
41386
41592
|
}
|
|
41387
41593
|
}
|
|
41388
41594
|
|
|
41389
|
-
/**
|
|
41390
|
-
* export types
|
|
41391
|
-
*/
|
|
41392
|
-
|
|
41393
|
-
/**
|
|
41394
|
-
* Tagged PDF module is used to handle tagged pdf document
|
|
41395
|
-
*
|
|
41396
|
-
* @hidden
|
|
41397
|
-
*/
|
|
41398
|
-
class TaggedPDF {
|
|
41399
|
-
/**
|
|
41400
|
-
* @param {PdfViewer} pdfViewer - The PdfViewer.
|
|
41401
|
-
* @param {PdfViewerBase} pdfViewerBase - The PdfViewerBase.
|
|
41402
|
-
* @private
|
|
41403
|
-
*/
|
|
41404
|
-
constructor(pdfViewer, pdfViewerBase) {
|
|
41405
|
-
this.createTag = function (taggedTextResponse) {
|
|
41406
|
-
let tagType = taggedTextResponse.TagType;
|
|
41407
|
-
let parentTagType = taggedTextResponse.ParentTagType;
|
|
41408
|
-
let text = taggedTextResponse.Text;
|
|
41409
|
-
let altText = taggedTextResponse.AltText;
|
|
41410
|
-
let bounds = taggedTextResponse.Bounds;
|
|
41411
|
-
let childTags = taggedTextResponse.ChildElements;
|
|
41412
|
-
let textTag = document.createElement(this.getTag(tagType));
|
|
41413
|
-
textTag.style = "padding:0px;margin:0px";
|
|
41414
|
-
if (parentTagType != "Document" && parentTagType != "Part") {
|
|
41415
|
-
textTag.style.position = 'absolute';
|
|
41416
|
-
}
|
|
41417
|
-
if (bounds) {
|
|
41418
|
-
this.setStyleToTaggedTextDiv(textTag, bounds);
|
|
41419
|
-
this.setTextElementProperties(textTag);
|
|
41420
|
-
}
|
|
41421
|
-
if (text.trim() != "") {
|
|
41422
|
-
textTag.innerText = text;
|
|
41423
|
-
}
|
|
41424
|
-
if (altText && altText.trim() !== "" && (tagType === "Image" || tagType === "Figure")) {
|
|
41425
|
-
textTag.alt = altText;
|
|
41426
|
-
textTag.src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNgYAAAAAMAASsJTYQAAAAASUVORK5CYII=";
|
|
41427
|
-
}
|
|
41428
|
-
if (childTags && childTags.length > 0) {
|
|
41429
|
-
childTags.forEach((element) => {
|
|
41430
|
-
if (tagType === "Table") {
|
|
41431
|
-
element.ChildElements.forEach((newelement) => {
|
|
41432
|
-
textTag.appendChild(this.createTag(newelement));
|
|
41433
|
-
});
|
|
41434
|
-
}
|
|
41435
|
-
else {
|
|
41436
|
-
textTag.appendChild(this.createTag(element));
|
|
41437
|
-
}
|
|
41438
|
-
});
|
|
41439
|
-
}
|
|
41440
|
-
return textTag;
|
|
41441
|
-
};
|
|
41442
|
-
this.pdfViewer = pdfViewer;
|
|
41443
|
-
this.pdfViewerBase = pdfViewerBase;
|
|
41444
|
-
}
|
|
41445
|
-
addTaggedLayer(pageIndex) {
|
|
41446
|
-
let taggedLayer;
|
|
41447
|
-
if (this.pdfViewer.enableTaggedPDF) {
|
|
41448
|
-
let pageDiv = document.getElementById(this.pdfViewer.element.id + '_pageDiv_' + pageIndex);
|
|
41449
|
-
taggedLayer = document.getElementById(this.pdfViewer.element.id + '_taggedLayer_' + pageIndex);
|
|
41450
|
-
if (!taggedLayer) {
|
|
41451
|
-
taggedLayer = createElement('div', { id: this.pdfViewer.element.id + '_taggedLayer_' + pageIndex, className: 'e-pv-tagged-layer e-pv-text-layer' });
|
|
41452
|
-
}
|
|
41453
|
-
taggedLayer.innerHTML = "";
|
|
41454
|
-
taggedLayer.style.width = this.pdfViewerBase.pageSize[parseInt(pageIndex.toString(), 10)].width * this.pdfViewerBase.getZoomFactor() + 'px';
|
|
41455
|
-
taggedLayer.style.height = this.pdfViewerBase.pageSize[parseInt(pageIndex.toString(), 10)].height * this.pdfViewerBase.getZoomFactor() + 'px';
|
|
41456
|
-
taggedLayer.style.pointerEvents = "none";
|
|
41457
|
-
if (pageDiv) {
|
|
41458
|
-
pageDiv.appendChild(taggedLayer);
|
|
41459
|
-
}
|
|
41460
|
-
}
|
|
41461
|
-
return taggedLayer;
|
|
41462
|
-
}
|
|
41463
|
-
renderTaggedTextContentsFromServer(pageIndex, taggedTextResponse) {
|
|
41464
|
-
let taggedLayer = this.addTaggedLayer(pageIndex);
|
|
41465
|
-
for (let i = 0; i < taggedTextResponse.length; i++) {
|
|
41466
|
-
var textDiv = createElement('div', { id: this.pdfViewer.element.id + '_taggedText_' + pageIndex + '_' + i, className: 'e-pv-text', attrs: { 'tabindex': '-1' } });
|
|
41467
|
-
let bounds = taggedTextResponse[i].Bounds;
|
|
41468
|
-
if (taggedTextResponse[i].TagType === "Paragraph" && taggedTextResponse[i].ChildElements === null && taggedTextResponse[i].Text.trim() === "") {
|
|
41469
|
-
continue;
|
|
41470
|
-
}
|
|
41471
|
-
else {
|
|
41472
|
-
textDiv.appendChild(this.createTag(taggedTextResponse[i]));
|
|
41473
|
-
}
|
|
41474
|
-
textDiv.style.display = "inline";
|
|
41475
|
-
this.setStyleToTaggedTextDiv(textDiv, bounds);
|
|
41476
|
-
this.setTextElementProperties(textDiv);
|
|
41477
|
-
taggedLayer.appendChild(textDiv);
|
|
41478
|
-
}
|
|
41479
|
-
}
|
|
41480
|
-
getTag(tagType) {
|
|
41481
|
-
switch (tagType) {
|
|
41482
|
-
case "Paragraph":
|
|
41483
|
-
return "p";
|
|
41484
|
-
case "Figure":
|
|
41485
|
-
return "img";
|
|
41486
|
-
case "Article":
|
|
41487
|
-
return "art";
|
|
41488
|
-
case "Annotation":
|
|
41489
|
-
return "annot";
|
|
41490
|
-
case "BibliographyEntry":
|
|
41491
|
-
return "bibentry";
|
|
41492
|
-
case "BlockQuotation":
|
|
41493
|
-
return "blockQuote";
|
|
41494
|
-
case "Caption":
|
|
41495
|
-
return "caption";
|
|
41496
|
-
case "Code":
|
|
41497
|
-
return "code";
|
|
41498
|
-
case "Division":
|
|
41499
|
-
return "div";
|
|
41500
|
-
case "Document":
|
|
41501
|
-
return "document";
|
|
41502
|
-
case "Form":
|
|
41503
|
-
return "form";
|
|
41504
|
-
case "Formula":
|
|
41505
|
-
return "formula";
|
|
41506
|
-
case "Index":
|
|
41507
|
-
return "index";
|
|
41508
|
-
case "Heading":
|
|
41509
|
-
return "h";
|
|
41510
|
-
case "HeadingLevel1":
|
|
41511
|
-
return "h1";
|
|
41512
|
-
case "HeadingLevel2":
|
|
41513
|
-
return "h2";
|
|
41514
|
-
case "HeadingLevel3":
|
|
41515
|
-
return "h3";
|
|
41516
|
-
case "HeadingLevel4":
|
|
41517
|
-
return "h4";
|
|
41518
|
-
case "HeadingLevel5":
|
|
41519
|
-
return "h5";
|
|
41520
|
-
case "HeadingLevel6":
|
|
41521
|
-
return "h6";
|
|
41522
|
-
case "Label":
|
|
41523
|
-
return "label";
|
|
41524
|
-
case "Link":
|
|
41525
|
-
return "a";
|
|
41526
|
-
case "List":
|
|
41527
|
-
return "ul";
|
|
41528
|
-
case "ListItem":
|
|
41529
|
-
return "li";
|
|
41530
|
-
case "ListBody":
|
|
41531
|
-
return "p";
|
|
41532
|
-
case "Note":
|
|
41533
|
-
return "note";
|
|
41534
|
-
case "Part":
|
|
41535
|
-
return "part";
|
|
41536
|
-
case "Quotation":
|
|
41537
|
-
return "quote";
|
|
41538
|
-
case "Reference":
|
|
41539
|
-
return "reference";
|
|
41540
|
-
case "Section":
|
|
41541
|
-
return "sect";
|
|
41542
|
-
case "Span":
|
|
41543
|
-
return "span";
|
|
41544
|
-
case "Table":
|
|
41545
|
-
return "table";
|
|
41546
|
-
case "TableDataCell":
|
|
41547
|
-
return "td";
|
|
41548
|
-
case "TableHeader":
|
|
41549
|
-
return "th";
|
|
41550
|
-
case "TableOfContent":
|
|
41551
|
-
return "toc";
|
|
41552
|
-
case "TableOfContentItem":
|
|
41553
|
-
return "toci";
|
|
41554
|
-
case "TableRow":
|
|
41555
|
-
return "tr";
|
|
41556
|
-
case "Image":
|
|
41557
|
-
return "img";
|
|
41558
|
-
default:
|
|
41559
|
-
return "p";
|
|
41560
|
-
}
|
|
41561
|
-
}
|
|
41562
|
-
;
|
|
41563
|
-
setStyleToTaggedTextDiv(textDiv, bounds) {
|
|
41564
|
-
textDiv.style.left = bounds.X * (96 / 72) * this.pdfViewerBase.getZoomFactor() + 'px';
|
|
41565
|
-
textDiv.style.top = bounds.Y * (96 / 72) * this.pdfViewerBase.getZoomFactor() + 'px';
|
|
41566
|
-
textDiv.style.width = bounds.Width * (96 / 72) * this.pdfViewerBase.getZoomFactor() + 'px';
|
|
41567
|
-
var textHeight = bounds.Height * (96 / 72) * this.pdfViewerBase.getZoomFactor();
|
|
41568
|
-
textDiv.style.height = textHeight + 'px';
|
|
41569
|
-
textDiv.style.fontSize = 16 * this.pdfViewerBase.getZoomFactor() + 'px';
|
|
41570
|
-
textDiv.style.color = 'transparent';
|
|
41571
|
-
}
|
|
41572
|
-
;
|
|
41573
|
-
setTextElementProperties(textDiv) {
|
|
41574
|
-
textDiv.style.fontFamily = 'serif';
|
|
41575
|
-
textDiv.style.transformOrigin = '0%';
|
|
41576
|
-
}
|
|
41577
|
-
/**
|
|
41578
|
-
* @private
|
|
41579
|
-
*/
|
|
41580
|
-
getModuleName() {
|
|
41581
|
-
return 'TaggedPDF';
|
|
41582
|
-
}
|
|
41583
|
-
}
|
|
41584
|
-
|
|
41585
41595
|
/**
|
|
41586
41596
|
* export types
|
|
41587
41597
|
*/
|
|
@@ -41598,5 +41608,5 @@ class TaggedPDF {
|
|
|
41598
41608
|
* export PDF viewer modules
|
|
41599
41609
|
*/
|
|
41600
41610
|
|
|
41601
|
-
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,
|
|
41611
|
+
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 };
|
|
41602
41612
|
//# sourceMappingURL=ej2-pdfviewer.es2015.js.map
|