@progress/kendo-pdfviewer-common 0.4.0-dev.202501060813 → 0.4.0-dev.202501141054
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/es/annotations/annotation-editor-ui-manager.js +0 -13
- package/dist/es/widget/pdfviewer.js +9 -5
- package/dist/es2015/annotations/annotation-editor-ui-manager.js +0 -13
- package/dist/es2015/widget/pdfviewer.js +9 -5
- package/dist/npm/annotations/annotation-editor-ui-manager.js +0 -13
- package/dist/npm/widget/pdfviewer.js +8 -4
- package/package.json +1 -1
|
@@ -471,20 +471,7 @@ export class AnnotationEditorUIManager {
|
|
|
471
471
|
if (!anchor) {
|
|
472
472
|
return;
|
|
473
473
|
}
|
|
474
|
-
// todo: disable showing a toolbar for other annotations
|
|
475
474
|
const annotationEditorMode = this.getMode();
|
|
476
|
-
if (annotationEditorMode === AnnotationEditorType.HIGHLIGHT) {
|
|
477
|
-
const editor = anchor.closest(".highlightEditor");
|
|
478
|
-
if (!editor) {
|
|
479
|
-
return;
|
|
480
|
-
}
|
|
481
|
-
}
|
|
482
|
-
if (annotationEditorMode === AnnotationEditorType.FREETEXT) {
|
|
483
|
-
const editor = anchor.closest(".freeTextEditor");
|
|
484
|
-
if (!editor) {
|
|
485
|
-
return;
|
|
486
|
-
}
|
|
487
|
-
}
|
|
488
475
|
if (annotationEditorMode !== AnnotationEditorType.HIGHLIGHT &&
|
|
489
476
|
annotationEditorMode !== AnnotationEditorType.FREETEXT) {
|
|
490
477
|
return;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var _PdfViewer_instances, _PdfViewer_annotationEditorMode, _PdfViewer_switchAnnotationEditorModeTimeoutId, _PdfViewer_eventAbortController, _PdfViewer_onPageRenderedCallback, _PdfViewer_switchToEditAnnotationMode, _PdfViewer_scrollIntoView;
|
|
2
2
|
import { __awaiter, __classPrivateFieldGet, __classPrivateFieldSet } from "tslib";
|
|
3
3
|
import { deepExtend, Component, isString, toArray, noop, hasValue, toClassSelector, addClass, removeClass, mousewheelDelta, convertToHtml, clamp, createPromise } from "../common/main";
|
|
4
|
-
import { currentPage, parsePdfFromBase64String, scale as
|
|
4
|
+
import { currentPage, parsePdfFromBase64String, scale as getRenderScale, adjustCanvasSize, createElement } from "../utils";
|
|
5
5
|
import { SearchService } from "../search";
|
|
6
6
|
import { Scroller } from "../scroller";
|
|
7
7
|
import { throttle } from "../scroller";
|
|
@@ -733,8 +733,14 @@ export class PdfViewer extends Component {
|
|
|
733
733
|
if (zoom <= 0) {
|
|
734
734
|
return;
|
|
735
735
|
}
|
|
736
|
-
const
|
|
737
|
-
|
|
736
|
+
const renderScale = getRenderScale();
|
|
737
|
+
let scaleNum = zoom * renderScale;
|
|
738
|
+
if (printUnits) {
|
|
739
|
+
scaleNum = zoom || renderScale;
|
|
740
|
+
}
|
|
741
|
+
// const scaleNum = zoom * renderScale;
|
|
742
|
+
// changing the viewport dimensions here requires changes in
|
|
743
|
+
// page.getPrintContentAsync for the printing dimensions
|
|
738
744
|
const viewport = pdfPage === null || pdfPage === void 0 ? void 0 : pdfPage.getViewport({ scale: scaleNum });
|
|
739
745
|
const { adjustedWidth, adjustedHeight, adjustRatio } = adjustCanvasSize(viewport.width, viewport.height);
|
|
740
746
|
// const styles = {
|
|
@@ -764,8 +770,6 @@ export class PdfViewer extends Component {
|
|
|
764
770
|
const canvasWrapper = convertToHtml(`
|
|
765
771
|
<div class="${this.options.elementSelectors.pageCanvasWrapper}"></div>
|
|
766
772
|
`);
|
|
767
|
-
// canvasWrapper.appendChild(canvas);
|
|
768
|
-
// pageElement.appendChild(canvasWrapper);
|
|
769
773
|
const adjustedScale = adjustRatio * scaleNum;
|
|
770
774
|
viewport.width = adjustedWidth;
|
|
771
775
|
viewport.height = adjustedHeight;
|
|
@@ -471,20 +471,7 @@ export class AnnotationEditorUIManager {
|
|
|
471
471
|
if (!anchor) {
|
|
472
472
|
return;
|
|
473
473
|
}
|
|
474
|
-
// todo: disable showing a toolbar for other annotations
|
|
475
474
|
const annotationEditorMode = this.getMode();
|
|
476
|
-
if (annotationEditorMode === AnnotationEditorType.HIGHLIGHT) {
|
|
477
|
-
const editor = anchor.closest(".highlightEditor");
|
|
478
|
-
if (!editor) {
|
|
479
|
-
return;
|
|
480
|
-
}
|
|
481
|
-
}
|
|
482
|
-
if (annotationEditorMode === AnnotationEditorType.FREETEXT) {
|
|
483
|
-
const editor = anchor.closest(".freeTextEditor");
|
|
484
|
-
if (!editor) {
|
|
485
|
-
return;
|
|
486
|
-
}
|
|
487
|
-
}
|
|
488
475
|
if (annotationEditorMode !== AnnotationEditorType.HIGHLIGHT &&
|
|
489
476
|
annotationEditorMode !== AnnotationEditorType.FREETEXT) {
|
|
490
477
|
return;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var _PdfViewer_instances, _PdfViewer_annotationEditorMode, _PdfViewer_switchAnnotationEditorModeTimeoutId, _PdfViewer_eventAbortController, _PdfViewer_onPageRenderedCallback, _PdfViewer_switchToEditAnnotationMode, _PdfViewer_scrollIntoView;
|
|
2
2
|
import { __awaiter, __classPrivateFieldGet, __classPrivateFieldSet } from "tslib";
|
|
3
3
|
import { deepExtend, Component, isString, toArray, noop, hasValue, toClassSelector, addClass, removeClass, mousewheelDelta, convertToHtml, clamp, createPromise } from "../common/main";
|
|
4
|
-
import { currentPage, parsePdfFromBase64String, scale as
|
|
4
|
+
import { currentPage, parsePdfFromBase64String, scale as getRenderScale, adjustCanvasSize, createElement } from "../utils";
|
|
5
5
|
import { SearchService } from "../search";
|
|
6
6
|
import { Scroller } from "../scroller";
|
|
7
7
|
import { throttle } from "../scroller";
|
|
@@ -733,8 +733,14 @@ export class PdfViewer extends Component {
|
|
|
733
733
|
if (zoom <= 0) {
|
|
734
734
|
return;
|
|
735
735
|
}
|
|
736
|
-
const
|
|
737
|
-
|
|
736
|
+
const renderScale = getRenderScale();
|
|
737
|
+
let scaleNum = zoom * renderScale;
|
|
738
|
+
if (printUnits) {
|
|
739
|
+
scaleNum = zoom || renderScale;
|
|
740
|
+
}
|
|
741
|
+
// const scaleNum = zoom * renderScale;
|
|
742
|
+
// changing the viewport dimensions here requires changes in
|
|
743
|
+
// page.getPrintContentAsync for the printing dimensions
|
|
738
744
|
const viewport = pdfPage === null || pdfPage === void 0 ? void 0 : pdfPage.getViewport({ scale: scaleNum });
|
|
739
745
|
const { adjustedWidth, adjustedHeight, adjustRatio } = adjustCanvasSize(viewport.width, viewport.height);
|
|
740
746
|
// const styles = {
|
|
@@ -764,8 +770,6 @@ export class PdfViewer extends Component {
|
|
|
764
770
|
const canvasWrapper = convertToHtml(`
|
|
765
771
|
<div class="${this.options.elementSelectors.pageCanvasWrapper}"></div>
|
|
766
772
|
`);
|
|
767
|
-
// canvasWrapper.appendChild(canvas);
|
|
768
|
-
// pageElement.appendChild(canvasWrapper);
|
|
769
773
|
const adjustedScale = adjustRatio * scaleNum;
|
|
770
774
|
viewport.width = adjustedWidth;
|
|
771
775
|
viewport.height = adjustedHeight;
|
|
@@ -474,20 +474,7 @@ class AnnotationEditorUIManager {
|
|
|
474
474
|
if (!anchor) {
|
|
475
475
|
return;
|
|
476
476
|
}
|
|
477
|
-
// todo: disable showing a toolbar for other annotations
|
|
478
477
|
const annotationEditorMode = this.getMode();
|
|
479
|
-
if (annotationEditorMode === pdf_mjs_1.AnnotationEditorType.HIGHLIGHT) {
|
|
480
|
-
const editor = anchor.closest(".highlightEditor");
|
|
481
|
-
if (!editor) {
|
|
482
|
-
return;
|
|
483
|
-
}
|
|
484
|
-
}
|
|
485
|
-
if (annotationEditorMode === pdf_mjs_1.AnnotationEditorType.FREETEXT) {
|
|
486
|
-
const editor = anchor.closest(".freeTextEditor");
|
|
487
|
-
if (!editor) {
|
|
488
|
-
return;
|
|
489
|
-
}
|
|
490
|
-
}
|
|
491
478
|
if (annotationEditorMode !== pdf_mjs_1.AnnotationEditorType.HIGHLIGHT &&
|
|
492
479
|
annotationEditorMode !== pdf_mjs_1.AnnotationEditorType.FREETEXT) {
|
|
493
480
|
return;
|
|
@@ -736,8 +736,14 @@ class PdfViewer extends main_1.Component {
|
|
|
736
736
|
if (zoom <= 0) {
|
|
737
737
|
return;
|
|
738
738
|
}
|
|
739
|
-
const
|
|
740
|
-
|
|
739
|
+
const renderScale = (0, utils_1.scale)();
|
|
740
|
+
let scaleNum = zoom * renderScale;
|
|
741
|
+
if (printUnits) {
|
|
742
|
+
scaleNum = zoom || renderScale;
|
|
743
|
+
}
|
|
744
|
+
// const scaleNum = zoom * renderScale;
|
|
745
|
+
// changing the viewport dimensions here requires changes in
|
|
746
|
+
// page.getPrintContentAsync for the printing dimensions
|
|
741
747
|
const viewport = pdfPage === null || pdfPage === void 0 ? void 0 : pdfPage.getViewport({ scale: scaleNum });
|
|
742
748
|
const { adjustedWidth, adjustedHeight, adjustRatio } = (0, utils_1.adjustCanvasSize)(viewport.width, viewport.height);
|
|
743
749
|
// const styles = {
|
|
@@ -767,8 +773,6 @@ class PdfViewer extends main_1.Component {
|
|
|
767
773
|
const canvasWrapper = (0, main_1.convertToHtml)(`
|
|
768
774
|
<div class="${this.options.elementSelectors.pageCanvasWrapper}"></div>
|
|
769
775
|
`);
|
|
770
|
-
// canvasWrapper.appendChild(canvas);
|
|
771
|
-
// pageElement.appendChild(canvasWrapper);
|
|
772
776
|
const adjustedScale = adjustRatio * scaleNum;
|
|
773
777
|
viewport.width = adjustedWidth;
|
|
774
778
|
viewport.height = adjustedHeight;
|
package/package.json
CHANGED