@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
|
@@ -27,6 +27,8 @@ export declare class Magnification {
|
|
|
27
27
|
private previousTouchDifference;
|
|
28
28
|
private touchCenterX;
|
|
29
29
|
private touchCenterY;
|
|
30
|
+
private mouseCenterX;
|
|
31
|
+
private mouseCenterY;
|
|
30
32
|
private pageRerenderCount;
|
|
31
33
|
private imageObjects;
|
|
32
34
|
private topValue;
|
|
@@ -67,6 +69,10 @@ export declare class Magnification {
|
|
|
67
69
|
* @private
|
|
68
70
|
*/
|
|
69
71
|
isAutoZoom: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* @private
|
|
74
|
+
*/
|
|
75
|
+
isDoubleTapZoom: boolean;
|
|
70
76
|
private isWebkitMobile;
|
|
71
77
|
/**
|
|
72
78
|
* @private
|
|
@@ -107,6 +113,11 @@ export declare class Magnification {
|
|
|
107
113
|
* Returns zoom factor for the fit zooms.
|
|
108
114
|
*/
|
|
109
115
|
private calculateFitZoomFactor;
|
|
116
|
+
/**
|
|
117
|
+
* Initiating cursor based zoom.
|
|
118
|
+
* @private
|
|
119
|
+
*/
|
|
120
|
+
initiateMouseZoom(pointX: number, pointY: number, zoomValue: number): void;
|
|
110
121
|
/**
|
|
111
122
|
* Performs pinch in operation
|
|
112
123
|
*/
|
|
@@ -151,6 +162,7 @@ export declare class Magnification {
|
|
|
151
162
|
private renderInSeparateThread;
|
|
152
163
|
private responsivePages;
|
|
153
164
|
private calculateScrollValues;
|
|
165
|
+
private calculateScrollValuesOnMouse;
|
|
154
166
|
private rerenderOnScroll;
|
|
155
167
|
/**
|
|
156
168
|
* @private
|
|
@@ -208,4 +220,16 @@ export declare class Magnification {
|
|
|
208
220
|
* @private
|
|
209
221
|
*/
|
|
210
222
|
getModuleName(): string;
|
|
223
|
+
/**
|
|
224
|
+
* Returns the pinch step value.
|
|
225
|
+
* @param higherValue
|
|
226
|
+
* @param lowerValue
|
|
227
|
+
*/
|
|
228
|
+
private getPinchStep;
|
|
229
|
+
/**
|
|
230
|
+
* Returns Point value respect to Main container.
|
|
231
|
+
* @param pointX
|
|
232
|
+
* @param pointY
|
|
233
|
+
*/
|
|
234
|
+
private positionInViewer;
|
|
211
235
|
}
|
|
@@ -19,7 +19,7 @@ var Magnification = /** @class */ (function () {
|
|
|
19
19
|
this.scrollWidth = 25;
|
|
20
20
|
this.zoomPercentages = [10, 25, 50, 75, 100, 125, 150, 200, 400];
|
|
21
21
|
this.isNotPredefinedZoom = false;
|
|
22
|
-
this.pinchStep = 0
|
|
22
|
+
this.pinchStep = 0;
|
|
23
23
|
this.reRenderPageNumber = 0;
|
|
24
24
|
// tslint:disable-next-line
|
|
25
25
|
this.magnifyPageRerenderTimer = null;
|
|
@@ -29,6 +29,8 @@ var Magnification = /** @class */ (function () {
|
|
|
29
29
|
this.rerenderInterval = null;
|
|
30
30
|
this.touchCenterX = 0;
|
|
31
31
|
this.touchCenterY = 0;
|
|
32
|
+
this.mouseCenterX = 0;
|
|
33
|
+
this.mouseCenterY = 0;
|
|
32
34
|
this.pageRerenderCount = 0;
|
|
33
35
|
this.imageObjects = [];
|
|
34
36
|
this.topValue = 0;
|
|
@@ -65,6 +67,10 @@ var Magnification = /** @class */ (function () {
|
|
|
65
67
|
* @private
|
|
66
68
|
*/
|
|
67
69
|
this.isAutoZoom = false;
|
|
70
|
+
/**
|
|
71
|
+
* @private
|
|
72
|
+
*/
|
|
73
|
+
this.isDoubleTapZoom = false;
|
|
68
74
|
this.isWebkitMobile = false;
|
|
69
75
|
this.pdfViewer = pdfViewer;
|
|
70
76
|
this.pdfViewerBase = viewerBase;
|
|
@@ -78,11 +84,13 @@ var Magnification = /** @class */ (function () {
|
|
|
78
84
|
* @returns void
|
|
79
85
|
*/
|
|
80
86
|
Magnification.prototype.zoomTo = function (zoomValue) {
|
|
81
|
-
|
|
82
|
-
|
|
87
|
+
var MaximumZoomPercentage = 400;
|
|
88
|
+
var MinmumZoomPercentage = 10;
|
|
89
|
+
if (zoomValue < MinmumZoomPercentage) {
|
|
90
|
+
zoomValue = MinmumZoomPercentage;
|
|
83
91
|
}
|
|
84
|
-
else if (zoomValue >
|
|
85
|
-
zoomValue =
|
|
92
|
+
else if (zoomValue > MaximumZoomPercentage) {
|
|
93
|
+
zoomValue = MaximumZoomPercentage;
|
|
86
94
|
}
|
|
87
95
|
this.fitType = null;
|
|
88
96
|
this.isNotPredefinedZoom = false;
|
|
@@ -222,6 +230,16 @@ var Magnification = /** @class */ (function () {
|
|
|
222
230
|
return parseInt(((viewerHeight / highestHeight) * 100).toString());
|
|
223
231
|
}
|
|
224
232
|
};
|
|
233
|
+
/**
|
|
234
|
+
* Initiating cursor based zoom.
|
|
235
|
+
* @private
|
|
236
|
+
*/
|
|
237
|
+
Magnification.prototype.initiateMouseZoom = function (pointX, pointY, zoomValue) {
|
|
238
|
+
var pointInViewer = this.positionInViewer(pointX, pointY);
|
|
239
|
+
this.mouseCenterX = pointInViewer.x;
|
|
240
|
+
this.mouseCenterY = pointInViewer.y;
|
|
241
|
+
this.zoomTo(zoomValue);
|
|
242
|
+
};
|
|
225
243
|
/**
|
|
226
244
|
* Performs pinch in operation
|
|
227
245
|
*/
|
|
@@ -231,8 +249,11 @@ var Magnification = /** @class */ (function () {
|
|
|
231
249
|
if (temporaryZoomFactor < 4 && temporaryZoomFactor > 2) {
|
|
232
250
|
temporaryZoomFactor = this.zoomFactor - this.pinchStep;
|
|
233
251
|
}
|
|
234
|
-
if (temporaryZoomFactor
|
|
235
|
-
temporaryZoomFactor =
|
|
252
|
+
if (temporaryZoomFactor <= 1.5) {
|
|
253
|
+
temporaryZoomFactor = this.zoomFactor - (this.pinchStep / 1.5);
|
|
254
|
+
}
|
|
255
|
+
if (temporaryZoomFactor < 0.25) {
|
|
256
|
+
temporaryZoomFactor = 0.25;
|
|
236
257
|
}
|
|
237
258
|
this.isPinchZoomed = true;
|
|
238
259
|
this.onZoomChanged(temporaryZoomFactor * 100);
|
|
@@ -252,8 +273,8 @@ var Magnification = /** @class */ (function () {
|
|
|
252
273
|
this.fitType = null;
|
|
253
274
|
var temporaryZoomFactor = this.zoomFactor + this.pinchStep;
|
|
254
275
|
if (Browser.isDevice) {
|
|
255
|
-
if (temporaryZoomFactor >
|
|
256
|
-
temporaryZoomFactor =
|
|
276
|
+
if (temporaryZoomFactor > 4) {
|
|
277
|
+
temporaryZoomFactor = 4;
|
|
257
278
|
}
|
|
258
279
|
}
|
|
259
280
|
else {
|
|
@@ -351,8 +372,9 @@ var Magnification = /** @class */ (function () {
|
|
|
351
372
|
* @private
|
|
352
373
|
*/
|
|
353
374
|
Magnification.prototype.setTouchPoints = function (clientX, clientY) {
|
|
354
|
-
|
|
355
|
-
this.
|
|
375
|
+
var pointInViewer = this.positionInViewer(clientX, clientY);
|
|
376
|
+
this.touchCenterX = pointInViewer.x;
|
|
377
|
+
this.touchCenterY = pointInViewer.y;
|
|
356
378
|
};
|
|
357
379
|
/**
|
|
358
380
|
* @private
|
|
@@ -361,8 +383,9 @@ var Magnification = /** @class */ (function () {
|
|
|
361
383
|
this.isPinchScrolled = false;
|
|
362
384
|
this.isMagnified = false;
|
|
363
385
|
this.reRenderPageNumber = this.pdfViewerBase.currentPageNumber;
|
|
364
|
-
|
|
365
|
-
this.
|
|
386
|
+
var pointInViewer = this.positionInViewer((pointX1 + pointX2) / 2, (pointY1 + pointY2) / 2);
|
|
387
|
+
this.touchCenterX = pointInViewer.x;
|
|
388
|
+
this.touchCenterY = pointInViewer.y;
|
|
366
389
|
this.zoomOverPages(pointX1, pointY1, pointX2, pointY2);
|
|
367
390
|
};
|
|
368
391
|
Magnification.prototype.magnifyPages = function () {
|
|
@@ -373,7 +396,7 @@ var Magnification = /** @class */ (function () {
|
|
|
373
396
|
if (!this.pdfViewerBase.documentLoaded) {
|
|
374
397
|
this.isPagesZoomed = true;
|
|
375
398
|
}
|
|
376
|
-
var scrollValue = this.
|
|
399
|
+
var scrollValue = this.pdfViewerBase.viewerContainer.scrollTop;
|
|
377
400
|
if (this.pdfViewer.textSelectionModule) {
|
|
378
401
|
this.pdfViewer.textSelectionModule.maintainSelectionOnZoom(false, true);
|
|
379
402
|
}
|
|
@@ -382,6 +405,7 @@ var Magnification = /** @class */ (function () {
|
|
|
382
405
|
}
|
|
383
406
|
this.updatePageLocation();
|
|
384
407
|
this.resizeCanvas(this.reRenderPageNumber);
|
|
408
|
+
this.calculateScrollValuesOnMouse(scrollValue);
|
|
385
409
|
if (this.pdfViewer.textSelectionModule) {
|
|
386
410
|
this.pdfViewer.textSelectionModule.resizeTouchElements();
|
|
387
411
|
}
|
|
@@ -397,7 +421,6 @@ var Magnification = /** @class */ (function () {
|
|
|
397
421
|
var proxy_1 = this;
|
|
398
422
|
this.pdfViewerBase.renderedPagesList = [];
|
|
399
423
|
this.pdfViewerBase.pinchZoomStorage = [];
|
|
400
|
-
this.pdfViewerBase.viewerContainer.scrollTop = scrollValue;
|
|
401
424
|
if (!this.pdfViewerBase.documentLoaded) {
|
|
402
425
|
this.magnifyPageRerenderTimer = setTimeout(function () { proxy_1.rerenderMagnifiedPages(); }, 800);
|
|
403
426
|
}
|
|
@@ -507,22 +530,66 @@ var Magnification = /** @class */ (function () {
|
|
|
507
530
|
var pageIndex = this.pdfViewerBase.currentPageNumber - 1;
|
|
508
531
|
var currentPageCanvas = this.pdfViewerBase.getElement('_pageDiv_' + pageIndex);
|
|
509
532
|
if (currentPageCanvas) {
|
|
533
|
+
var pointInViewer = void 0;
|
|
510
534
|
var currentPageBounds = currentPageCanvas.getBoundingClientRect();
|
|
535
|
+
if (this.pdfViewer.enableRtl && !this.isDoubleTapZoom) {
|
|
536
|
+
pointInViewer = this.positionInViewer(currentPageBounds.right, currentPageBounds.top);
|
|
537
|
+
}
|
|
538
|
+
else {
|
|
539
|
+
pointInViewer = this.positionInViewer(currentPageBounds.left, currentPageBounds.top);
|
|
540
|
+
}
|
|
541
|
+
var currentPageBoundsLeft = pointInViewer.x;
|
|
542
|
+
var currentPageBoundsTop = pointInViewer.y;
|
|
511
543
|
// update scroll top for the viewer container based on pinch zoom factor
|
|
512
|
-
var previousPageTop = (
|
|
513
|
-
var
|
|
514
|
-
//
|
|
515
|
-
var
|
|
516
|
-
//
|
|
544
|
+
var previousPageTop = (currentPageBoundsTop) * this.previousZoomFactor;
|
|
545
|
+
var canvasPreviousY = scrollValue + this.touchCenterY;
|
|
546
|
+
// eslint-disable-next-line max-len
|
|
547
|
+
var canvasCurrentY = (currentPageBoundsTop) * this.zoomFactor + ((canvasPreviousY - previousPageTop) < 0 ? canvasPreviousY - previousPageTop : (canvasPreviousY -
|
|
548
|
+
// eslint-disable-next-line max-len
|
|
517
549
|
previousPageTop) * (this.zoomFactor / this.previousZoomFactor));
|
|
518
|
-
this.pdfViewerBase.
|
|
550
|
+
var pageGapValue = this.zoomFactor - this.previousZoomFactor > 0 ? -this.pdfViewerBase.pageGap * (this.zoomFactor / this.previousZoomFactor) : this.pdfViewerBase.pageGap * (this.previousZoomFactor / this.zoomFactor);
|
|
551
|
+
this.pdfViewerBase.viewerContainer.scrollTop = canvasCurrentY - this.touchCenterY + pageGapValue / this.pdfViewerBase.zoomInterval;
|
|
519
552
|
// update scroll left for the viewer container based on pinch zoom factor
|
|
520
|
-
var
|
|
521
|
-
var scaleCorrectionFactor = this.zoomFactor /
|
|
522
|
-
var scrollX_1 = this.touchCenterX -
|
|
553
|
+
var previousWidthFactor = (currentPageBounds.width * this.previousZoomFactor) / currentPageBounds.width;
|
|
554
|
+
var scaleCorrectionFactor = this.zoomFactor / previousWidthFactor - 1;
|
|
555
|
+
var scrollX_1 = this.touchCenterX - currentPageBoundsLeft;
|
|
523
556
|
this.pdfViewerBase.viewerContainer.scrollLeft += scrollX_1 * scaleCorrectionFactor;
|
|
524
557
|
}
|
|
525
558
|
};
|
|
559
|
+
Magnification.prototype.calculateScrollValuesOnMouse = function (scrollValue) {
|
|
560
|
+
var pageIndex = this.pdfViewerBase.currentPageNumber - 1;
|
|
561
|
+
var currentPageCanvas = this.pdfViewerBase.getElement('_pageDiv_' + pageIndex);
|
|
562
|
+
if (currentPageCanvas) {
|
|
563
|
+
var pointInViewer = void 0;
|
|
564
|
+
var currentPageBounds = currentPageCanvas.getBoundingClientRect();
|
|
565
|
+
if (this.pdfViewer.enableRtl) {
|
|
566
|
+
pointInViewer = this.positionInViewer(currentPageBounds.right, currentPageBounds.top);
|
|
567
|
+
}
|
|
568
|
+
else {
|
|
569
|
+
pointInViewer = this.positionInViewer(currentPageBounds.left, currentPageBounds.top);
|
|
570
|
+
}
|
|
571
|
+
var currentPageBoundsLeft = pointInViewer.x;
|
|
572
|
+
var currentPageBoundsTop = pointInViewer.y;
|
|
573
|
+
// update scroll top for the viewer container based on mouse zoom factor
|
|
574
|
+
var previousPageTop = (currentPageBoundsTop) * this.previousZoomFactor;
|
|
575
|
+
var canvasPreviousY = scrollValue + this.mouseCenterY;
|
|
576
|
+
// eslint-disable-next-line max-len
|
|
577
|
+
var canvasCurrentY = (currentPageBoundsTop) * this.zoomFactor + ((canvasPreviousY - previousPageTop) < 0 ? canvasPreviousY - previousPageTop : (canvasPreviousY -
|
|
578
|
+
// eslint-disable-next-line max-len
|
|
579
|
+
previousPageTop) * (this.zoomFactor / this.previousZoomFactor));
|
|
580
|
+
// eslint-disable-next-line max-len
|
|
581
|
+
var pageGapValue = this.zoomFactor - this.previousZoomFactor > 0 ? -this.pdfViewerBase.pageGap * (this.zoomFactor / this.previousZoomFactor) : this.pdfViewerBase.pageGap * (this.previousZoomFactor / this.zoomFactor);
|
|
582
|
+
if (this.pdfViewerBase.isTouchPad && !this.pdfViewerBase.isMacSafari) {
|
|
583
|
+
pageGapValue = pageGapValue / this.pdfViewerBase.zoomInterval;
|
|
584
|
+
}
|
|
585
|
+
this.pdfViewerBase.viewerContainer.scrollTop = canvasCurrentY - this.mouseCenterY + pageGapValue;
|
|
586
|
+
// update scroll left for the viewer container based on mouse zoom factor
|
|
587
|
+
var previousWidthFactor = (currentPageBounds.width * this.previousZoomFactor) / currentPageBounds.width;
|
|
588
|
+
var scaleCorrectionFactor = this.zoomFactor / previousWidthFactor - 1;
|
|
589
|
+
var scrollX_2 = this.mouseCenterX - currentPageBoundsLeft;
|
|
590
|
+
this.pdfViewerBase.viewerContainer.scrollLeft += scrollX_2 * scaleCorrectionFactor;
|
|
591
|
+
}
|
|
592
|
+
};
|
|
526
593
|
Magnification.prototype.rerenderOnScroll = function () {
|
|
527
594
|
var _this = this;
|
|
528
595
|
this.isPinchZoomed = false;
|
|
@@ -885,9 +952,11 @@ var Magnification = /** @class */ (function () {
|
|
|
885
952
|
var currentDifference = Math.sqrt(Math.pow((pointX1 - pointX2), 2) + Math.pow((pointY1 - pointY2), 2));
|
|
886
953
|
if (this.previousTouchDifference > -1) {
|
|
887
954
|
if (currentDifference > this.previousTouchDifference) {
|
|
955
|
+
this.pinchStep = this.getPinchStep(currentDifference, this.previousTouchDifference);
|
|
888
956
|
this.pinchOut();
|
|
889
957
|
}
|
|
890
958
|
else if (currentDifference < this.previousTouchDifference) {
|
|
959
|
+
this.pinchStep = this.getPinchStep(this.previousTouchDifference, currentDifference);
|
|
891
960
|
this.pinchIn();
|
|
892
961
|
}
|
|
893
962
|
}
|
|
@@ -1000,19 +1069,23 @@ var Magnification = /** @class */ (function () {
|
|
|
1000
1069
|
this.pdfViewer.toolbarModule.showToolbar(false);
|
|
1001
1070
|
}
|
|
1002
1071
|
var scrollValue = this.pdfViewerBase.viewerContainer.scrollTop;
|
|
1003
|
-
if (!this.
|
|
1004
|
-
|
|
1005
|
-
|
|
1072
|
+
if (!this.pdfViewer.selectedItems.annotations[0]) {
|
|
1073
|
+
this.isDoubleTapZoom = true;
|
|
1074
|
+
if (!this.isTapToFitZoom) {
|
|
1075
|
+
if (this.zoomFactor < 2) {
|
|
1076
|
+
this.zoomTo(200);
|
|
1077
|
+
}
|
|
1078
|
+
else {
|
|
1079
|
+
this.fitToWidth();
|
|
1080
|
+
}
|
|
1006
1081
|
}
|
|
1007
1082
|
else {
|
|
1008
1083
|
this.fitToWidth();
|
|
1009
1084
|
}
|
|
1085
|
+
this.calculateScrollValues(scrollValue);
|
|
1086
|
+
this.isTapToFitZoom = !this.isTapToFitZoom;
|
|
1087
|
+
this.isDoubleTapZoom = false;
|
|
1010
1088
|
}
|
|
1011
|
-
else {
|
|
1012
|
-
this.fitToWidth();
|
|
1013
|
-
}
|
|
1014
|
-
this.calculateScrollValues(scrollValue);
|
|
1015
|
-
this.isTapToFitZoom = !this.isTapToFitZoom;
|
|
1016
1089
|
};
|
|
1017
1090
|
Magnification.prototype.downwardScrollFitPage = function (currentPageIndex) {
|
|
1018
1091
|
if (currentPageIndex !== (this.pdfViewerBase.pageCount - 1)) {
|
|
@@ -1047,6 +1120,32 @@ var Magnification = /** @class */ (function () {
|
|
|
1047
1120
|
Magnification.prototype.getModuleName = function () {
|
|
1048
1121
|
return 'Magnification';
|
|
1049
1122
|
};
|
|
1123
|
+
/**
|
|
1124
|
+
* Returns the pinch step value.
|
|
1125
|
+
* @param higherValue
|
|
1126
|
+
* @param lowerValue
|
|
1127
|
+
*/
|
|
1128
|
+
Magnification.prototype.getPinchStep = function (higherValue, lowerValue) {
|
|
1129
|
+
var defaultPinchStep = 0.02; // Default pinch step value.
|
|
1130
|
+
var higherPinchStep = 1; // higher pinch step value.
|
|
1131
|
+
var pinchstep = (higherValue - lowerValue) / 100;
|
|
1132
|
+
if (pinchstep < defaultPinchStep) {
|
|
1133
|
+
pinchstep = defaultPinchStep;
|
|
1134
|
+
}
|
|
1135
|
+
else if (pinchstep > higherPinchStep) {
|
|
1136
|
+
pinchstep = 0.1; // set the pinch step as 0.1 if the pinch reaches the higher pinch step value.
|
|
1137
|
+
}
|
|
1138
|
+
return pinchstep;
|
|
1139
|
+
};
|
|
1140
|
+
/**
|
|
1141
|
+
* Returns Point value respect to Main container.
|
|
1142
|
+
* @param pointX
|
|
1143
|
+
* @param pointY
|
|
1144
|
+
*/
|
|
1145
|
+
Magnification.prototype.positionInViewer = function (pointX, pointY) {
|
|
1146
|
+
var mainRect = this.pdfViewerBase.mainContainer.getBoundingClientRect();
|
|
1147
|
+
return { x: pointX - mainRect.left, y: pointY - mainRect.top };
|
|
1148
|
+
};
|
|
1050
1149
|
return Magnification;
|
|
1051
1150
|
}());
|
|
1052
1151
|
export { Magnification };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, INotifyPropertyChanged, NotifyPropertyChanges, ChildProperty, L10n, Collection, Complex } from '@syncfusion/ej2-base';
|
|
1
|
+
import { Component, INotifyPropertyChanged, NotifyPropertyChanges, ChildProperty, L10n, Collection, Complex } from '@syncfusion/ej2-base';
|
|
2
2
|
import {IAjaxHeaders} from "./pdfviewer";
|
|
3
3
|
import {ComponentModel} from '@syncfusion/ej2-base';
|
|
4
4
|
|
|
@@ -2016,24 +2016,25 @@ export interface PdfViewerModel extends ComponentModel{
|
|
|
2016
2016
|
enableZoomOptimization?: boolean;
|
|
2017
2017
|
|
|
2018
2018
|
/**
|
|
2019
|
-
*
|
|
2020
|
-
*
|
|
2019
|
+
* Specifies the response status codes for retrying a failed request with a "3xx", "4xx", or "5xx" response status code.
|
|
2020
|
+
* The value can have multiple values, such as [500, 401, 400], and the default value is 500.
|
|
2021
|
+
*
|
|
2022
|
+
* @default [500]
|
|
2021
2023
|
*/
|
|
2022
|
-
|
|
2024
|
+
retryStatusCodes?: number[];
|
|
2023
2025
|
|
|
2024
2026
|
/**
|
|
2025
|
-
*
|
|
2026
|
-
*
|
|
2027
|
+
* Specifies the retry timeout for all requests in seconds.
|
|
2028
|
+
*
|
|
2029
|
+
* @default 0
|
|
2027
2030
|
*/
|
|
2028
|
-
|
|
2031
|
+
retryTimeout?: number;
|
|
2029
2032
|
|
|
2030
2033
|
/**
|
|
2031
|
-
*
|
|
2032
|
-
*
|
|
2033
|
-
*
|
|
2034
|
-
* @default [500]
|
|
2034
|
+
* Enable or disables the get the document text collections.
|
|
2035
|
+
* @default false
|
|
2035
2036
|
*/
|
|
2036
|
-
|
|
2037
|
+
isExtractText?: boolean;
|
|
2037
2038
|
|
|
2038
2039
|
/**
|
|
2039
2040
|
* Defines the settings of the PdfViewer toolbar.
|
|
@@ -17,7 +17,6 @@ import { TextSelection } from './index';
|
|
|
17
17
|
import { TextSearch } from './index';
|
|
18
18
|
import { FormFields } from './index';
|
|
19
19
|
import { Print, CalibrationUnit } from './index';
|
|
20
|
-
import { TaggedPDF } from './index';
|
|
21
20
|
import { UnloadEventArgs, LoadEventArgs, LoadFailedEventArgs, AjaxRequestFailureEventArgs, PageChangeEventArgs, PageClickEventArgs, ZoomChangeEventArgs, HyperlinkClickEventArgs, HyperlinkMouseOverArgs, ImportStartEventArgs, ImportSuccessEventArgs, ImportFailureEventArgs, ExportStartEventArgs, ExportSuccessEventArgs, ExportFailureEventArgs, AjaxRequestInitiateEventArgs, BeforeRenderPdfPageEventArgs, AjaxRequestSuccessEventArgs } from './index';
|
|
22
21
|
import { AnnotationAddEventArgs, AnnotationRemoveEventArgs, AnnotationPropertiesChangeEventArgs, AnnotationResizeEventArgs, AnnotationSelectEventArgs, AnnotationMoveEventArgs, AnnotationDoubleClickEventArgs, AnnotationMouseoverEventArgs, PageMouseoverEventArgs } from './index';
|
|
23
22
|
import { TextSelectionStartEventArgs, TextSelectionEndEventArgs, DownloadStartEventArgs, DownloadEndEventArgs, ExtractTextCompletedEventArgs } from './index';
|
|
@@ -1679,16 +1678,6 @@ export declare class PdfViewer extends Component<HTMLElement> implements INotify
|
|
|
1679
1678
|
* @default true
|
|
1680
1679
|
*/
|
|
1681
1680
|
enableZoomOptimization: boolean;
|
|
1682
|
-
/**
|
|
1683
|
-
* Enable or disables the get the document text collections.
|
|
1684
|
-
* @default false
|
|
1685
|
-
*/
|
|
1686
|
-
isExtractText: boolean;
|
|
1687
|
-
/**
|
|
1688
|
-
*
|
|
1689
|
-
* @default true
|
|
1690
|
-
*/
|
|
1691
|
-
enableTaggedPDF: boolean;
|
|
1692
1681
|
/**
|
|
1693
1682
|
* Specifies the response status codes for retrying a failed request with a "3xx", "4xx", or "5xx" response status code.
|
|
1694
1683
|
* The value can have multiple values, such as [500, 401, 400], and the default value is 500.
|
|
@@ -1696,6 +1685,17 @@ export declare class PdfViewer extends Component<HTMLElement> implements INotify
|
|
|
1696
1685
|
* @default [500]
|
|
1697
1686
|
*/
|
|
1698
1687
|
retryStatusCodes: number[];
|
|
1688
|
+
/**
|
|
1689
|
+
* The time span timeout for retries in seconds.
|
|
1690
|
+
*
|
|
1691
|
+
* @default 0
|
|
1692
|
+
*/
|
|
1693
|
+
retryTimeout: number;
|
|
1694
|
+
/**
|
|
1695
|
+
* Enable or disables the get the document text collections.
|
|
1696
|
+
* @default false
|
|
1697
|
+
*/
|
|
1698
|
+
isExtractText: boolean;
|
|
1699
1699
|
/**
|
|
1700
1700
|
* Defines the settings of the PdfViewer toolbar.
|
|
1701
1701
|
*/
|
|
@@ -1884,10 +1884,6 @@ export declare class PdfViewer extends Component<HTMLElement> implements INotify
|
|
|
1884
1884
|
* @private
|
|
1885
1885
|
*/
|
|
1886
1886
|
textSearchModule: TextSearch;
|
|
1887
|
-
/**
|
|
1888
|
-
* @private
|
|
1889
|
-
*/
|
|
1890
|
-
taggedPDFModule: TaggedPDF;
|
|
1891
1887
|
/**
|
|
1892
1888
|
* @private
|
|
1893
1889
|
*/
|
|
@@ -1935,14 +1931,6 @@ export declare class PdfViewer extends Component<HTMLElement> implements INotify
|
|
|
1935
1931
|
* @returns { TextSearch }
|
|
1936
1932
|
*/
|
|
1937
1933
|
readonly textSearch: TextSearch;
|
|
1938
|
-
/**
|
|
1939
|
-
* Gets the tagged layer object of the pdf viewer.
|
|
1940
|
-
*
|
|
1941
|
-
* @asptype TaggedPDF
|
|
1942
|
-
* @blazorType TaggedPDF
|
|
1943
|
-
* @returns { TaggedPDF }
|
|
1944
|
-
*/
|
|
1945
|
-
readonly taggedPdf: TaggedPDF;
|
|
1946
1934
|
/**
|
|
1947
1935
|
* Gets the toolbar object of the pdf viewer.
|
|
1948
1936
|
* @asptype Toolbar
|
|
@@ -1587,20 +1587,6 @@ var PdfViewer = /** @class */ (function (_super) {
|
|
|
1587
1587
|
enumerable: true,
|
|
1588
1588
|
configurable: true
|
|
1589
1589
|
});
|
|
1590
|
-
Object.defineProperty(PdfViewer.prototype, "taggedPdf", {
|
|
1591
|
-
/**
|
|
1592
|
-
* Gets the tagged layer object of the pdf viewer.
|
|
1593
|
-
*
|
|
1594
|
-
* @asptype TaggedPDF
|
|
1595
|
-
* @blazorType TaggedPDF
|
|
1596
|
-
* @returns { TaggedPDF }
|
|
1597
|
-
*/
|
|
1598
|
-
get: function () {
|
|
1599
|
-
return this.taggedPDFModule;
|
|
1600
|
-
},
|
|
1601
|
-
enumerable: true,
|
|
1602
|
-
configurable: true
|
|
1603
|
-
});
|
|
1604
1590
|
Object.defineProperty(PdfViewer.prototype, "toolbar", {
|
|
1605
1591
|
/**
|
|
1606
1592
|
* Gets the toolbar object of the pdf viewer.
|
|
@@ -1835,11 +1821,6 @@ var PdfViewer = /** @class */ (function (_super) {
|
|
|
1835
1821
|
member: 'FormFields', args: [this, this.viewerBase]
|
|
1836
1822
|
});
|
|
1837
1823
|
}
|
|
1838
|
-
if (this.enableTaggedPDF) {
|
|
1839
|
-
modules.push({
|
|
1840
|
-
member: 'TaggedPDF', args: [this, this.viewerBase]
|
|
1841
|
-
});
|
|
1842
|
-
}
|
|
1843
1824
|
return modules;
|
|
1844
1825
|
};
|
|
1845
1826
|
/**
|
|
@@ -2691,15 +2672,15 @@ var PdfViewer = /** @class */ (function (_super) {
|
|
|
2691
2672
|
__decorate([
|
|
2692
2673
|
Property(true)
|
|
2693
2674
|
], PdfViewer.prototype, "enableZoomOptimization", void 0);
|
|
2694
|
-
__decorate([
|
|
2695
|
-
Property(false)
|
|
2696
|
-
], PdfViewer.prototype, "isExtractText", void 0);
|
|
2697
|
-
__decorate([
|
|
2698
|
-
Property(true)
|
|
2699
|
-
], PdfViewer.prototype, "enableTaggedPDF", void 0);
|
|
2700
2675
|
__decorate([
|
|
2701
2676
|
Property([500])
|
|
2702
2677
|
], PdfViewer.prototype, "retryStatusCodes", void 0);
|
|
2678
|
+
__decorate([
|
|
2679
|
+
Property(0)
|
|
2680
|
+
], PdfViewer.prototype, "retryTimeout", void 0);
|
|
2681
|
+
__decorate([
|
|
2682
|
+
Property(false)
|
|
2683
|
+
], PdfViewer.prototype, "isExtractText", void 0);
|
|
2703
2684
|
__decorate([
|
|
2704
2685
|
Property({ showTooltip: true, toolbarItems: ['OpenOption', 'UndoRedoTool', 'PageNavigationTool', 'MagnificationTool', 'PanTool', 'SelectionTool', 'CommentTool', 'AnnotationEditTool', 'FreeTextAnnotationOption', 'InkAnnotationOption', 'ShapeAnnotationOption', 'StampAnnotation', 'SignatureOption', 'SearchOption', 'PrintOption', 'DownloadOption'] })
|
|
2705
2686
|
], PdfViewer.prototype, "toolbarSettings", void 0);
|
|
@@ -152,7 +152,9 @@ var Toolbar = /** @class */ (function () {
|
|
|
152
152
|
Toolbar.prototype.showToolbar = function (enableToolbar) {
|
|
153
153
|
var toolbar = this.toolbarElement;
|
|
154
154
|
if (enableToolbar) {
|
|
155
|
-
toolbar
|
|
155
|
+
if (toolbar) {
|
|
156
|
+
toolbar.style.display = 'block';
|
|
157
|
+
}
|
|
156
158
|
if (Browser.isDevice && this.pdfViewer.toolbarModule && this.pdfViewer.toolbarModule.annotationToolbarModule) {
|
|
157
159
|
this.pdfViewer.toolbarModule.annotationToolbarModule.hideMobileAnnotationToolbar();
|
|
158
160
|
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { PdfViewer, PdfViewerBase } from '../index';
|
|
2
|
-
/**
|
|
3
|
-
* Tagged PDF module is used to handle tagged pdf document
|
|
4
|
-
*
|
|
5
|
-
* @hidden
|
|
6
|
-
*/
|
|
7
|
-
export declare class TaggedPDF {
|
|
8
|
-
private pdfViewer;
|
|
9
|
-
private pdfViewerBase;
|
|
10
|
-
/**
|
|
11
|
-
* @param {PdfViewer} pdfViewer - The PdfViewer.
|
|
12
|
-
* @param {PdfViewerBase} pdfViewerBase - The PdfViewerBase.
|
|
13
|
-
* @private
|
|
14
|
-
*/
|
|
15
|
-
constructor(pdfViewer: PdfViewer, pdfViewerBase: PdfViewerBase);
|
|
16
|
-
addTaggedLayer(pageIndex: number): HTMLElement;
|
|
17
|
-
renderTaggedTextContentsFromServer(pageIndex: number, taggedTextResponse: any): void;
|
|
18
|
-
private createTag;
|
|
19
|
-
private getTag;
|
|
20
|
-
private setStyleToTaggedTextDiv;
|
|
21
|
-
private setTextElementProperties;
|
|
22
|
-
/**
|
|
23
|
-
* @private
|
|
24
|
-
*/
|
|
25
|
-
getModuleName(): string;
|
|
26
|
-
}
|