@progress/kendo-angular-pdfviewer 19.3.0-develop.24 → 19.3.0-develop.26

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.
@@ -2,11 +2,11 @@
2
2
  * Copyright © 2025 Progress Software Corporation. All rights reserved.
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
- import { ChangeDetectorRef, Component, ElementRef, EventEmitter, HostBinding, Input, NgZone, Output, Renderer2, ViewChild, isDevMode } from '@angular/core';
5
+ import { ChangeDetectorRef, Component, ElementRef, EventEmitter, HostBinding, Input, NgZone, Output, Renderer2, ViewChild, ViewContainerRef, isDevMode } from '@angular/core';
6
6
  import { validatePackage } from '@progress/kendo-licensing';
7
7
  import { packageMetadata } from './package-metadata';
8
8
  import { INITIAL_ZOOM_LEVEL, zoomOptionsData, zoomToFitOptions } from './util';
9
- import { PdfViewer, removeChildren, } from '@progress/kendo-pdfviewer-common';
9
+ import { PdfViewer, removeChildren, PdfViewerInteractionMode, } from '@progress/kendo-pdfviewer-common';
10
10
  import { EventsOutsideAngularDirective, hasObservers, shouldShowValidationUI, getLicenseMessage, WatermarkOverlayComponent } from '@progress/kendo-angular-common';
11
11
  import { LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
12
12
  import { PDFViewerDownloadEvent } from './models/events';
@@ -18,8 +18,12 @@ import { LoaderComponent } from './loader/loader.component';
18
18
  import { NgIf } from '@angular/common';
19
19
  import { LocalizedPDFViewerMessagesDirective } from './localization/localized-messages.directive';
20
20
  import 'pdfjs-dist/build/pdf.worker.min.mjs';
21
+ import { AnnotationEditorTypes } from './models/annotation-editor.type';
22
+ import { PopupService } from '@progress/kendo-angular-popup';
23
+ import { AnnotationPopupToolbarContentComponent } from './annotations/annotation-editor';
21
24
  import * as i0 from "@angular/core";
22
25
  import * as i1 from "@progress/kendo-angular-l10n";
26
+ import * as i2 from "@progress/kendo-angular-popup";
23
27
  let counter = 0;
24
28
  /**
25
29
  * Represents the [Kendo UI PDFViewer component for Angular](slug:overview_pdfviewer).
@@ -42,11 +46,13 @@ export class PDFViewerComponent {
42
46
  localizationService;
43
47
  cdr;
44
48
  host;
49
+ popupService;
45
50
  hostClass = true;
46
51
  direction;
52
+ display = 'flex';
47
53
  /**
48
54
  * Represents the tools collection rendered in the toolbar.
49
- * @default ['pager', 'spacer', 'zoomInOut', 'zoom', 'selection', 'spacer', 'search', 'open', 'download', 'print' ]
55
+ * @default ['pager', 'spacer', 'zoomInOut', 'zoom', 'selection', 'spacer', 'search', 'open', 'download', 'print', 'annotations' ]
50
56
  */
51
57
  tools = [
52
58
  'pager',
@@ -58,7 +64,8 @@ export class PDFViewerComponent {
58
64
  'search',
59
65
  'open',
60
66
  'download',
61
- 'print'
67
+ 'print',
68
+ 'annotations'
62
69
  ];
63
70
  /**
64
71
  * The configuration of the internal Loader component.
@@ -143,6 +150,12 @@ export class PDFViewerComponent {
143
150
  * @default 1
144
151
  */
145
152
  loadOnDemandPageSize = 1;
153
+ /**
154
+ * Determines whether a confirmation dialog is shown when the user tries to delete an annotation.
155
+ *
156
+ * @default true
157
+ */
158
+ removeAnnotationConfirmation = true;
146
159
  /**
147
160
  * Fires when the component loads a PDF document successfully.
148
161
  */
@@ -164,6 +177,8 @@ export class PDFViewerComponent {
164
177
  */
165
178
  zoomLevelChange = new EventEmitter();
166
179
  pagesContainer;
180
+ pagesContainerViewContainerRef;
181
+ dialogContainerViewContainerRef;
167
182
  /**
168
183
  * Returns the current page number of the loaded PDF document.
169
184
  */
@@ -198,17 +213,30 @@ export class PDFViewerComponent {
198
213
  }
199
214
  return `k-pdfviewer-${counter}-pages-container`;
200
215
  }
216
+ /**
217
+ * @hidden
218
+ */
219
+ get annotationsToolbarId() {
220
+ return `k-pdfviewer-${counter}-annotations-toolbar`;
221
+ }
222
+ /**
223
+ * @hidden
224
+ */
225
+ get annotationsToolId() {
226
+ return `k-pdfviewer-${counter}-annotations-button`;
227
+ }
201
228
  loading = false;
202
229
  searchActive = false;
203
230
  matchCase = false;
204
231
  currentMatches = [];
205
232
  currentMatch;
233
+ showAnnotationsToolbar = false;
206
234
  /**
207
235
  * @hidden
208
236
  */
209
237
  set enabledSelection(value) {
210
238
  if (this.pdfViewerWidget) {
211
- value ? this.pdfViewerWidget.documentScroller.disablePanEventsTracking() : this.pdfViewerWidget.documentScroller.enablePanEventsTracking();
239
+ this.ngZone.runOutsideAngular(() => this.pdfViewerWidget.setInteractionMode({ mode: value ? PdfViewerInteractionMode.TextSelection : PdfViewerInteractionMode.Pan }));
212
240
  }
213
241
  this._enabledSelection = value;
214
242
  }
@@ -218,6 +246,14 @@ export class PDFViewerComponent {
218
246
  get enabledSelection() {
219
247
  return this._enabledSelection;
220
248
  }
249
+ /**
250
+ * @hidden
251
+ */
252
+ onSetAnnotationMode(mode) {
253
+ this.pdfViewerWidget?.resetAnnotationEditorMode();
254
+ this.pdfViewerWidget?.setInteractionMode({ mode: PdfViewerInteractionMode.TextSelection });
255
+ this.pdfViewerWidget?.setAnnotationEditorMode({ mode: AnnotationEditorTypes[mode], interactionMode: PdfViewerInteractionMode.TextSelection });
256
+ }
221
257
  /**
222
258
  * @hidden
223
259
  */
@@ -235,13 +271,16 @@ export class PDFViewerComponent {
235
271
  _fitType;
236
272
  _zoomToFit = false;
237
273
  subs = new Subscription();
274
+ popupSub = new Subscription();
238
275
  emitLoad = true;
239
- constructor(ngZone, renderer, localizationService, cdr, host) {
276
+ pdfViewerWidget;
277
+ constructor(ngZone, renderer, localizationService, cdr, host, popupService) {
240
278
  this.ngZone = ngZone;
241
279
  this.renderer = renderer;
242
280
  this.localizationService = localizationService;
243
281
  this.cdr = cdr;
244
282
  this.host = host;
283
+ this.popupService = popupService;
245
284
  const isValid = validatePackage(packageMetadata);
246
285
  this.licenseMessage = getLicenseMessage(packageMetadata);
247
286
  this.showLicenseWatermark = shouldShowValidationUI(isValid);
@@ -253,8 +292,11 @@ export class PDFViewerComponent {
253
292
  }
254
293
  ngOnDestroy() {
255
294
  this.subs.unsubscribe();
295
+ this.popupSub?.unsubscribe();
256
296
  this.pdfViewerWidget?.destroy();
257
297
  this.pdfContext = null;
298
+ this.observer?.disconnect();
299
+ this.observer = null;
258
300
  }
259
301
  ngOnChanges(changes) {
260
302
  const newBase64Data = changes['data'] && this.data;
@@ -294,6 +336,27 @@ export class PDFViewerComponent {
294
336
  onPageChange(e) {
295
337
  this.ngZone.runOutsideAngular(() => this.scrollToPage(e.skip + 1));
296
338
  }
339
+ /**
340
+ * @hidden
341
+ */
342
+ onPanningEnabled() {
343
+ this.enabledSelection = false;
344
+ this.showAnnotationsToolbar = false;
345
+ this.ngZone.runOutsideAngular(() => {
346
+ this.pdfViewerWidget?.resetAnnotationEditorMode();
347
+ this.pdfViewerWidget?.setInteractionMode({ mode: PdfViewerInteractionMode.Pan });
348
+ });
349
+ }
350
+ /**
351
+ * @hidden
352
+ */
353
+ onSelectionEnabled() {
354
+ this.enabledSelection = true;
355
+ this.ngZone.runOutsideAngular(() => {
356
+ this.pdfViewerWidget?.resetAnnotationEditorMode();
357
+ this.pdfViewerWidget?.setInteractionMode({ mode: PdfViewerInteractionMode.TextSelection });
358
+ });
359
+ }
297
360
  /**
298
361
  * @hidden
299
362
  */
@@ -418,7 +481,16 @@ export class PDFViewerComponent {
418
481
  this.pdfViewerWidget?.goToPreviousSearchMatch();
419
482
  this.currentMatch = this.currentMatch - 1 < 1 ? this.currentMatches.length : this.currentMatch - 1;
420
483
  }
421
- pdfViewerWidget;
484
+ /**
485
+ * @hidden
486
+ */
487
+ toggleAnnotationsToolbar() {
488
+ this.showAnnotationsToolbar = !this.showAnnotationsToolbar;
489
+ this.host.nativeElement.querySelector(`#${this.annotationsToolId}`)?.focus();
490
+ if (!this.showAnnotationsToolbar) {
491
+ this.pdfViewerWidget?.resetAnnotationEditorMode();
492
+ }
493
+ }
422
494
  loadPdf(dataType, data) {
423
495
  this.pdfViewerWidget?.destroy();
424
496
  this.loading = true;
@@ -443,7 +515,9 @@ export class PDFViewerComponent {
443
515
  this.loading = false;
444
516
  },
445
517
  scroll: this.scrollHandler,
446
- error: this.errorHandler
518
+ error: this.errorHandler,
519
+ annotationEditorToolBarShow: this.onAnnotationEditorToolBarShowHandler,
520
+ annotationEditorToolBarHide: this.onAnnotationEditorToolBarHideHandler,
447
521
  }
448
522
  });
449
523
  });
@@ -491,6 +565,7 @@ export class PDFViewerComponent {
491
565
  if (!this.pdfContext) {
492
566
  this.pdfViewerWidget.documentScroller.enablePanEventsTracking();
493
567
  }
568
+ this.pdfViewerWidget.setInteractionMode({ mode: PdfViewerInteractionMode.Pan });
494
569
  if (!this._zoomToFit) {
495
570
  this.pdfContext = { ...e, element: this.pagesContainer.nativeElement, zoom: e.sender.state.zoomLevel };
496
571
  if (this.emitLoad) {
@@ -503,6 +578,7 @@ export class PDFViewerComponent {
503
578
  this.pdfContext = { ...e, element: this.pagesContainer.nativeElement };
504
579
  this.onZoomLevelChange(zoomLevelOption, false);
505
580
  }
581
+ this.pdfViewerWidget.activatePageNumber(1);
506
582
  this.cdr.markForCheck();
507
583
  this.assignPageIds();
508
584
  this.ngZone.run(() => this.loading = false);
@@ -520,19 +596,80 @@ export class PDFViewerComponent {
520
596
  this.pdfContext = null;
521
597
  this.zoneAwareEmitter('error', { error: e, context: this.pdfContext });
522
598
  };
599
+ annotationPopup = null;
600
+ observer;
601
+ onAnnotationEditorToolBarShowHandler = (e) => {
602
+ this.cdr.markForCheck();
603
+ this.observer?.disconnect();
604
+ const type = e.annotationEditorMode;
605
+ const anchor = e.anchor;
606
+ const editor = e.source.firstSelectedEditor;
607
+ const popup = this.annotationPopup?.popup;
608
+ // Do not continue if popup is already visible for this annotation.
609
+ if (popup && popup.instance.anchor === anchor && type === "freeText") {
610
+ return;
611
+ }
612
+ if (this.annotationPopup) {
613
+ this.annotationPopup.close();
614
+ this.annotationPopup = null;
615
+ }
616
+ this.annotationPopup = this.popupService.open({
617
+ anchor: anchor,
618
+ appendTo: this.pagesContainerViewContainerRef,
619
+ content: AnnotationPopupToolbarContentComponent,
620
+ popupClass: 'k-pdfviewer-annotation-popup',
621
+ });
622
+ const annotationToolbarInstance = this.annotationPopup.content.instance;
623
+ annotationToolbarInstance.localizationService = this.localizationService;
624
+ annotationToolbarInstance.annotationEditorType = type;
625
+ annotationToolbarInstance.pdfViewerWidget = this.pdfViewerWidget;
626
+ annotationToolbarInstance.anchor = anchor;
627
+ annotationToolbarInstance.popupRef = this.annotationPopup;
628
+ annotationToolbarInstance.initialColor = editor?.color;
629
+ annotationToolbarInstance.initialFontSize = editor.propertiesToUpdate[0][1];
630
+ annotationToolbarInstance.dialogContainer = this.dialogContainerViewContainerRef;
631
+ annotationToolbarInstance.removeAnnotationConfirmation = this.removeAnnotationConfirmation;
632
+ this.popupSub = this.annotationPopup.popup.instance.anchorViewportLeave.subscribe(() => {
633
+ this.ngZone.run(() => this.annotationPopup?.close());
634
+ this.annotationPopup = null;
635
+ this.popupSub?.unsubscribe();
636
+ this.popupSub = null;
637
+ });
638
+ this.ngZone.runOutsideAngular(() => {
639
+ this.observer = this.classMutationObserver(anchor, 'k-selected', () => {
640
+ this.ngZone.run(() => this.annotationPopup?.close());
641
+ });
642
+ });
643
+ };
644
+ onAnnotationEditorToolBarHideHandler = () => {
645
+ this.cdr.markForCheck();
646
+ if (this.annotationPopup?.popup) {
647
+ this.annotationPopup.close();
648
+ this.annotationPopup = null;
649
+ }
650
+ };
523
651
  zoneAwareEmitter = (eventName, eventData) => {
524
652
  if (hasObservers(this[eventName])) {
525
653
  this.ngZone.run(() => this[eventName].emit(eventData));
526
654
  }
527
655
  };
528
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PDFViewerComponent, deps: [{ token: i0.NgZone }, { token: i0.Renderer2 }, { token: i1.LocalizationService }, { token: i0.ChangeDetectorRef }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
529
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: PDFViewerComponent, isStandalone: true, selector: "kendo-pdfviewer", inputs: { tools: "tools", loaderSettings: "loaderSettings", saveFileName: "saveFileName", saveOptions: "saveOptions", url: "url", data: "data", arrayBuffer: "arrayBuffer", typedArray: "typedArray", zoom: "zoom", zoomRate: "zoomRate", minZoom: "minZoom", maxZoom: "maxZoom", loadOnDemand: "loadOnDemand", loadOnDemandPageSize: "loadOnDemandPageSize" }, outputs: { load: "load", error: "error", download: "download", pageChange: "pageChange", zoomLevelChange: "zoomLevelChange" }, host: { properties: { "class.k-pdf-viewer": "this.hostClass", "attr.dir": "this.direction" } }, providers: [
656
+ classMutationObserver = (element, className, callback) => {
657
+ const observer = new MutationObserver((m) => {
658
+ m.forEach(() => {
659
+ callback();
660
+ });
661
+ });
662
+ observer.observe(element, { attributeFilter: ['class'] });
663
+ return observer;
664
+ };
665
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PDFViewerComponent, deps: [{ token: i0.NgZone }, { token: i0.Renderer2 }, { token: i1.LocalizationService }, { token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i2.PopupService }], target: i0.ɵɵFactoryTarget.Component });
666
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: PDFViewerComponent, isStandalone: true, selector: "kendo-pdfviewer", inputs: { tools: "tools", loaderSettings: "loaderSettings", saveFileName: "saveFileName", saveOptions: "saveOptions", url: "url", data: "data", arrayBuffer: "arrayBuffer", typedArray: "typedArray", zoom: "zoom", zoomRate: "zoomRate", minZoom: "minZoom", maxZoom: "maxZoom", loadOnDemand: "loadOnDemand", loadOnDemandPageSize: "loadOnDemandPageSize", removeAnnotationConfirmation: "removeAnnotationConfirmation" }, outputs: { load: "load", error: "error", download: "download", pageChange: "pageChange", zoomLevelChange: "zoomLevelChange" }, host: { properties: { "class.k-pdf-viewer": "this.hostClass", "attr.dir": "this.direction", "attr.display": "this.display" } }, providers: [
530
667
  LocalizationService,
531
668
  {
532
669
  provide: L10N_PREFIX,
533
670
  useValue: 'kendo.pdfviewer'
534
671
  }
535
- ], viewQueries: [{ propertyName: "pagesContainer", first: true, predicate: ["pagesContainer"], descendants: true }], exportAs: ["kendo-pdfviewer"], usesOnChanges: true, ngImport: i0, template: `
672
+ ], viewQueries: [{ propertyName: "pagesContainer", first: true, predicate: ["pagesContainer"], descendants: true }, { propertyName: "pagesContainerViewContainerRef", first: true, predicate: ["pagesContainer"], descendants: true, read: ViewContainerRef }, { propertyName: "dialogContainerViewContainerRef", first: true, predicate: ["dialogContainer"], descendants: true, read: ViewContainerRef }], exportAs: ["kendo-pdfviewer"], usesOnChanges: true, ngImport: i0, template: `
536
673
  <ng-container kendoPDFViewerLocalizedMessages
537
674
  i18n-pagerFirstPage="kendo.pdfviewer.pagerFirstPage|The label for the first page button in the Pager"
538
675
  pagerFirstPage="Go to the first page"
@@ -607,7 +744,43 @@ export class PDFViewerComponent {
607
744
  searchMatchCaseTitle="Match case"
608
745
 
609
746
  i18n-zoomInputPlaceholder="kendo.pdfviewer.zoomInputPlaceholder|The text for the zoom tool input placeholder."
610
- zoomInputPlaceholder="Choose zoom level">
747
+ zoomInputPlaceholder="Choose zoom level"
748
+
749
+ i18n-annotationsTitle="kendo.pdfviewer.annotationsTitle|The Annotations tool title and label."
750
+ annotationsTitle="Annotations"
751
+
752
+ i18n-annotationEditorTitle="kendo.pdfviewer.annotationEditorTitle|The annotation editor tool title and label."
753
+ annotationEditorTitle="Annotation editor"
754
+
755
+ i18n-deleteAnnotationTitle="kendo.pdfviewer.deleteAnnotationTitle|The delete annotation tool title and label."
756
+ deleteAnnotationTitle="Delete annotation"
757
+
758
+ i18n-highlightAnnotationTitle="kendo.pdfviewer.highlightAnnotationTitle|The highlight annotation tool title and label."
759
+ highlightAnnotationTitle="Highlight"
760
+
761
+ i18n-freeTextAnnotationTitle="kendo.pdfviewer.freeTextAnnotationTitle|The free text annotation tool title and label."
762
+ freeTextAnnotationTitle="Free text"
763
+
764
+ i18n-closeAnnotationsToolbarTitle="kendo.pdfviewer.closeAnnotationsToolbarTitle|The close annotations toolbar tool title and label."
765
+ closeAnnotationsToolbarTitle="Close"
766
+
767
+ i18n-deleteAnnotationConfirmationDialogTitle="kendo.pdfviewer.deleteAnnotationConfirmationDialogTitle|The delete annotation confirmation dialog title."
768
+ deleteAnnotationConfirmationDialogTitle="Delete annotation"
769
+
770
+ i18n-deleteAnnotationConfirmationDialogContent="kendo.pdfviewer.deleteAnnotationConfirmationDialogContent|The delete annotation confirmation dialog content."
771
+ deleteAnnotationConfirmationDialogContent="Are you sure you want to delete this annotation?"
772
+
773
+ i18n-deleteAnnotationConfirmationDialogConfirmText="kendo.pdfviewer.deleteAnnotationConfirmationDialogConfirmText|The delete annotation confirmation dialog confirm button text."
774
+ deleteAnnotationConfirmationDialogConfirmText="Delete"
775
+
776
+ i18n-deleteAnnotationConfirmationDialogRejectText="kendo.pdfviewer.deleteAnnotationConfirmationDialogRejectText|The delete annotation confirmation dialog reject button text."
777
+ deleteAnnotationConfirmationDialogRejectText="Cancel"
778
+
779
+ i18n-annotationEditorFontSizeTitle="kendo.pdfviewer.annotationEditorFontSizeTitle|The annotation editor font size section title."
780
+ annotationEditorFontSizeTitle="Font size"
781
+
782
+ i18n-annotationEditorColorTitle="kendo.pdfviewer.annotationEditorColorTitle|The annotation editor color section title."
783
+ annotationEditorColorTitle="Color">
611
784
  </ng-container>
612
785
  <div kendoPDFViewerLoader
613
786
  *ngIf="loading"
@@ -625,18 +798,32 @@ export class PDFViewerComponent {
625
798
  [zoomOptionsData]="zoomOptionsData"
626
799
  [zoomLevelChooserValue]="zoomLevel"
627
800
  [disabledTools]="!pdfContext?.pdfDoc"
801
+ [isAnnotationsToolbarVisible]="showAnnotationsToolbar"
802
+ [wrapperId]="showAnnotationsToolbar ? annotationsToolbarId : undefined"
803
+ [annotationsToolId]="annotationsToolId"
628
804
  (pageChange)="onPageChange($event)"
629
805
  (fileSelect)="onFileSelect($event)"
630
806
  (fileSelectStart)="loading = true;"
631
807
  (fileSelectError)="onFileSelectError($event)"
632
808
  (download)="onDownload()"
633
- (panningEnabled)="enabledSelection = false;"
634
- (selectionEnabled)="enabledSelection = true;"
809
+ (panningEnabled)="onPanningEnabled();"
810
+ (selectionEnabled)="onSelectionEnabled();"
635
811
  (zoomIn)="onZoomIn()"
636
812
  (zoomOut)="onZoomOut()"
637
813
  (zoomLevelChange)="onZoomLevelChange($event)"
638
814
  (print)="onPrint()"
639
- (search)="onSearch()"></div>
815
+ (search)="onSearch()"
816
+ (toggleAnnotationsToolbar)="toggleAnnotationsToolbar()"></div>
817
+ <div *ngIf="showAnnotationsToolbar"
818
+ [attr.id]="annotationsToolbarId"
819
+ kendoPDFViewerToolbar
820
+ #toolbar
821
+ role="toolbar"
822
+ type="annotations"
823
+ (setAnnotationMode)="onSetAnnotationMode($event)"
824
+ [attr.aria-controls]="pagesContainerId"
825
+ [disabledTools]="!pdfContext?.pdfDoc"
826
+ (toggleAnnotationsToolbar)="toggleAnnotationsToolbar()"></div>
640
827
  <div
641
828
  class="k-canvas k-pdf-viewer-canvas k-pos-relative k-overflow-auto"
642
829
  [class.k-enable-text-select]="enabledSelection"
@@ -662,8 +849,9 @@ export class PDFViewerComponent {
662
849
  [attr.id]="pagesContainerId"></div>
663
850
  </div>
664
851
 
852
+ <div #dialogContainer></div>
665
853
  <div kendoWatermarkOverlay *ngIf="showLicenseWatermark" [licenseMessage]="licenseMessage"></div>
666
- `, isInline: true, dependencies: [{ kind: "directive", type: LocalizedPDFViewerMessagesDirective, selector: "[kendoPDFViewerLocalizedMessages]" }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: EventsOutsideAngularDirective, selector: "[kendoEventsOutsideAngular]", inputs: ["kendoEventsOutsideAngular", "scope"] }, { kind: "component", type: LoaderComponent, selector: "[kendoPDFViewerLoader]", inputs: ["settings"] }, { kind: "component", type: ToolbarComponent, selector: "[kendoPDFViewerToolbar]", inputs: ["zoomLevel", "calculatedComboBoxValue", "skip", "pageSize", "total", "zoomInDisabled", "zoomOutDisabled", "disabledTools", "zoomLevelChooserValue", "zoomOptionsData", "pagesContainerId", "tools"], outputs: ["fileSelect", "fileSelectStart", "fileSelectError", "download", "selectionEnabled", "panningEnabled", "pageChange", "zoomIn", "zoomOut", "zoomLevelChange", "print", "search"] }, { kind: "component", type: PDFViewerSearchComponent, selector: "[kendoPDFViewerSearch]", inputs: ["matches", "currentMatch"], outputs: ["searchChange", "prevMatch", "nextMatch", "close"] }, { kind: "component", type: WatermarkOverlayComponent, selector: "div[kendoWatermarkOverlay]", inputs: ["licenseMessage"] }] });
854
+ `, isInline: true, dependencies: [{ kind: "directive", type: LocalizedPDFViewerMessagesDirective, selector: "[kendoPDFViewerLocalizedMessages]" }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: EventsOutsideAngularDirective, selector: "[kendoEventsOutsideAngular]", inputs: ["kendoEventsOutsideAngular", "scope"] }, { kind: "component", type: LoaderComponent, selector: "[kendoPDFViewerLoader]", inputs: ["settings"] }, { kind: "component", type: ToolbarComponent, selector: "[kendoPDFViewerToolbar]", inputs: ["zoomLevel", "calculatedComboBoxValue", "skip", "pageSize", "total", "zoomInDisabled", "zoomOutDisabled", "disabledTools", "zoomLevelChooserValue", "zoomOptionsData", "pagesContainerId", "tools", "type", "wrapperId", "isAnnotationsToolbarVisible", "annotationsToolId"], outputs: ["fileSelect", "fileSelectStart", "fileSelectError", "download", "selectionEnabled", "panningEnabled", "pageChange", "zoomIn", "zoomOut", "zoomLevelChange", "print", "search", "toggleAnnotationsToolbar", "setAnnotationMode"] }, { kind: "component", type: PDFViewerSearchComponent, selector: "[kendoPDFViewerSearch]", inputs: ["matches", "currentMatch"], outputs: ["searchChange", "prevMatch", "nextMatch", "close"] }, { kind: "component", type: WatermarkOverlayComponent, selector: "div[kendoWatermarkOverlay]", inputs: ["licenseMessage"] }] });
667
855
  }
668
856
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PDFViewerComponent, decorators: [{
669
857
  type: Component,
@@ -752,7 +940,43 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
752
940
  searchMatchCaseTitle="Match case"
753
941
 
754
942
  i18n-zoomInputPlaceholder="kendo.pdfviewer.zoomInputPlaceholder|The text for the zoom tool input placeholder."
755
- zoomInputPlaceholder="Choose zoom level">
943
+ zoomInputPlaceholder="Choose zoom level"
944
+
945
+ i18n-annotationsTitle="kendo.pdfviewer.annotationsTitle|The Annotations tool title and label."
946
+ annotationsTitle="Annotations"
947
+
948
+ i18n-annotationEditorTitle="kendo.pdfviewer.annotationEditorTitle|The annotation editor tool title and label."
949
+ annotationEditorTitle="Annotation editor"
950
+
951
+ i18n-deleteAnnotationTitle="kendo.pdfviewer.deleteAnnotationTitle|The delete annotation tool title and label."
952
+ deleteAnnotationTitle="Delete annotation"
953
+
954
+ i18n-highlightAnnotationTitle="kendo.pdfviewer.highlightAnnotationTitle|The highlight annotation tool title and label."
955
+ highlightAnnotationTitle="Highlight"
956
+
957
+ i18n-freeTextAnnotationTitle="kendo.pdfviewer.freeTextAnnotationTitle|The free text annotation tool title and label."
958
+ freeTextAnnotationTitle="Free text"
959
+
960
+ i18n-closeAnnotationsToolbarTitle="kendo.pdfviewer.closeAnnotationsToolbarTitle|The close annotations toolbar tool title and label."
961
+ closeAnnotationsToolbarTitle="Close"
962
+
963
+ i18n-deleteAnnotationConfirmationDialogTitle="kendo.pdfviewer.deleteAnnotationConfirmationDialogTitle|The delete annotation confirmation dialog title."
964
+ deleteAnnotationConfirmationDialogTitle="Delete annotation"
965
+
966
+ i18n-deleteAnnotationConfirmationDialogContent="kendo.pdfviewer.deleteAnnotationConfirmationDialogContent|The delete annotation confirmation dialog content."
967
+ deleteAnnotationConfirmationDialogContent="Are you sure you want to delete this annotation?"
968
+
969
+ i18n-deleteAnnotationConfirmationDialogConfirmText="kendo.pdfviewer.deleteAnnotationConfirmationDialogConfirmText|The delete annotation confirmation dialog confirm button text."
970
+ deleteAnnotationConfirmationDialogConfirmText="Delete"
971
+
972
+ i18n-deleteAnnotationConfirmationDialogRejectText="kendo.pdfviewer.deleteAnnotationConfirmationDialogRejectText|The delete annotation confirmation dialog reject button text."
973
+ deleteAnnotationConfirmationDialogRejectText="Cancel"
974
+
975
+ i18n-annotationEditorFontSizeTitle="kendo.pdfviewer.annotationEditorFontSizeTitle|The annotation editor font size section title."
976
+ annotationEditorFontSizeTitle="Font size"
977
+
978
+ i18n-annotationEditorColorTitle="kendo.pdfviewer.annotationEditorColorTitle|The annotation editor color section title."
979
+ annotationEditorColorTitle="Color">
756
980
  </ng-container>
757
981
  <div kendoPDFViewerLoader
758
982
  *ngIf="loading"
@@ -770,18 +994,32 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
770
994
  [zoomOptionsData]="zoomOptionsData"
771
995
  [zoomLevelChooserValue]="zoomLevel"
772
996
  [disabledTools]="!pdfContext?.pdfDoc"
997
+ [isAnnotationsToolbarVisible]="showAnnotationsToolbar"
998
+ [wrapperId]="showAnnotationsToolbar ? annotationsToolbarId : undefined"
999
+ [annotationsToolId]="annotationsToolId"
773
1000
  (pageChange)="onPageChange($event)"
774
1001
  (fileSelect)="onFileSelect($event)"
775
1002
  (fileSelectStart)="loading = true;"
776
1003
  (fileSelectError)="onFileSelectError($event)"
777
1004
  (download)="onDownload()"
778
- (panningEnabled)="enabledSelection = false;"
779
- (selectionEnabled)="enabledSelection = true;"
1005
+ (panningEnabled)="onPanningEnabled();"
1006
+ (selectionEnabled)="onSelectionEnabled();"
780
1007
  (zoomIn)="onZoomIn()"
781
1008
  (zoomOut)="onZoomOut()"
782
1009
  (zoomLevelChange)="onZoomLevelChange($event)"
783
1010
  (print)="onPrint()"
784
- (search)="onSearch()"></div>
1011
+ (search)="onSearch()"
1012
+ (toggleAnnotationsToolbar)="toggleAnnotationsToolbar()"></div>
1013
+ <div *ngIf="showAnnotationsToolbar"
1014
+ [attr.id]="annotationsToolbarId"
1015
+ kendoPDFViewerToolbar
1016
+ #toolbar
1017
+ role="toolbar"
1018
+ type="annotations"
1019
+ (setAnnotationMode)="onSetAnnotationMode($event)"
1020
+ [attr.aria-controls]="pagesContainerId"
1021
+ [disabledTools]="!pdfContext?.pdfDoc"
1022
+ (toggleAnnotationsToolbar)="toggleAnnotationsToolbar()"></div>
785
1023
  <div
786
1024
  class="k-canvas k-pdf-viewer-canvas k-pos-relative k-overflow-auto"
787
1025
  [class.k-enable-text-select]="enabledSelection"
@@ -807,17 +1045,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
807
1045
  [attr.id]="pagesContainerId"></div>
808
1046
  </div>
809
1047
 
1048
+ <div #dialogContainer></div>
810
1049
  <div kendoWatermarkOverlay *ngIf="showLicenseWatermark" [licenseMessage]="licenseMessage"></div>
811
1050
  `,
812
1051
  standalone: true,
813
1052
  imports: [LocalizedPDFViewerMessagesDirective, NgIf, EventsOutsideAngularDirective, LoaderComponent, ToolbarComponent, PDFViewerSearchComponent, WatermarkOverlayComponent]
814
1053
  }]
815
- }], ctorParameters: function () { return [{ type: i0.NgZone }, { type: i0.Renderer2 }, { type: i1.LocalizationService }, { type: i0.ChangeDetectorRef }, { type: i0.ElementRef }]; }, propDecorators: { hostClass: [{
1054
+ }], ctorParameters: function () { return [{ type: i0.NgZone }, { type: i0.Renderer2 }, { type: i1.LocalizationService }, { type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i2.PopupService }]; }, propDecorators: { hostClass: [{
816
1055
  type: HostBinding,
817
1056
  args: ['class.k-pdf-viewer']
818
1057
  }], direction: [{
819
1058
  type: HostBinding,
820
1059
  args: ['attr.dir']
1060
+ }], display: [{
1061
+ type: HostBinding,
1062
+ args: ['attr.display']
821
1063
  }], tools: [{
822
1064
  type: Input
823
1065
  }], loaderSettings: [{
@@ -846,6 +1088,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
846
1088
  type: Input
847
1089
  }], loadOnDemandPageSize: [{
848
1090
  type: Input
1091
+ }], removeAnnotationConfirmation: [{
1092
+ type: Input
849
1093
  }], load: [{
850
1094
  type: Output
851
1095
  }], error: [{
@@ -859,4 +1103,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
859
1103
  }], pagesContainer: [{
860
1104
  type: ViewChild,
861
1105
  args: ['pagesContainer']
1106
+ }], pagesContainerViewContainerRef: [{
1107
+ type: ViewChild,
1108
+ args: ['pagesContainer', { read: ViewContainerRef }]
1109
+ }], dialogContainerViewContainerRef: [{
1110
+ type: ViewChild,
1111
+ args: ['dialogContainer', { read: ViewContainerRef }]
862
1112
  }] } });