@progress/kendo-pdfviewer-common 0.4.2-develop.1 → 0.5.0-develop.1

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.
Files changed (29) hide show
  1. package/dist/es/annotations/annotation-editor-ui-manager.js +25 -0
  2. package/dist/es/annotations/annotation-layer-builder.js +2 -2
  3. package/dist/es/annotations/annotation-layer.js +352 -337
  4. package/dist/es/annotations/helpers/annotation-storage.js +14 -0
  5. package/dist/es/annotations/shared/event_utils.js +6 -0
  6. package/dist/es/utils.js +2 -2
  7. package/dist/es/widget/page.js +1 -0
  8. package/dist/es/widget/pdfviewer.js +20 -6
  9. package/dist/es2015/annotations/annotation-editor-ui-manager.js +25 -0
  10. package/dist/es2015/annotations/annotation-layer-builder.js +2 -2
  11. package/dist/es2015/annotations/annotation-layer.js +352 -337
  12. package/dist/es2015/annotations/helpers/annotation-storage.js +14 -0
  13. package/dist/es2015/annotations/shared/event_utils.js +6 -0
  14. package/dist/es2015/utils.js +2 -2
  15. package/dist/es2015/widget/page.js +1 -0
  16. package/dist/es2015/widget/pdfviewer.js +20 -6
  17. package/dist/npm/annotations/annotation-editor-ui-manager.d.ts +3 -0
  18. package/dist/npm/annotations/annotation-editor-ui-manager.js +25 -0
  19. package/dist/npm/annotations/annotation-layer-builder.js +2 -2
  20. package/dist/npm/annotations/annotation-layer.js +352 -337
  21. package/dist/npm/annotations/helpers/annotation-storage.d.ts +10 -0
  22. package/dist/npm/annotations/helpers/annotation-storage.js +14 -0
  23. package/dist/npm/annotations/shared/event_utils.d.ts +4 -0
  24. package/dist/npm/annotations/shared/event_utils.js +6 -0
  25. package/dist/npm/utils.js +2 -2
  26. package/dist/npm/widget/page.js +1 -0
  27. package/dist/npm/widget/pdfviewer.d.ts +1 -0
  28. package/dist/npm/widget/pdfviewer.js +20 -6
  29. package/package.json +1 -1
@@ -242,6 +242,9 @@ export class AnnotationEditorUIManager {
242
242
  this._eventBus._on("setpreference", this.onSetPreference.bind(this), {
243
243
  signal
244
244
  });
245
+ this._eventBus._on("namedaction", this.onNamedAction.bind(this), {
246
+ signal
247
+ });
245
248
  __classPrivateFieldGet(this, _AnnotationEditorUIManager_instances, "m", _AnnotationEditorUIManager_addSelectionListener).call(this);
246
249
  __classPrivateFieldGet(this, _AnnotationEditorUIManager_instances, "m", _AnnotationEditorUIManager_addDragAndDropListeners).call(this);
247
250
  __classPrivateFieldGet(this, _AnnotationEditorUIManager_instances, "m", _AnnotationEditorUIManager_addKeyboardManager).call(this);
@@ -388,6 +391,18 @@ export class AnnotationEditorUIManager {
388
391
  default: break;
389
392
  }
390
393
  }
394
+ onNamedAction(event) {
395
+ // Processing a couple of named actions that might be useful, see also
396
+ // `PDFLinkService.executeNamedAction`.
397
+ switch (event.action) {
398
+ case "Print":
399
+ this.triggerPrinting();
400
+ break;
401
+ case "SaveAs":
402
+ this.downloadOrSave();
403
+ break;
404
+ }
405
+ }
391
406
  onPageChanging({ pageNumber }) {
392
407
  __classPrivateFieldSet(this, _AnnotationEditorUIManager_currentPageIndex, pageNumber - 1, "f");
393
408
  }
@@ -407,6 +422,16 @@ export class AnnotationEditorUIManager {
407
422
  }
408
423
  return null;
409
424
  }
425
+ triggerPrinting() {
426
+ var _a;
427
+ (_a = this.pdfViewer) === null || _a === void 0 ? void 0 : _a.printFile();
428
+ }
429
+ downloadOrSave() {
430
+ var _a, _b;
431
+ (_a = this.pdfViewer) === null || _a === void 0 ? void 0 : _a.downloadFile({
432
+ fileName: (_b = this.pdfViewer) === null || _b === void 0 ? void 0 : _b.options.downloadFileName
433
+ });
434
+ }
410
435
  disableUserSelect(value = false) {
411
436
  var _a;
412
437
  (_a = __classPrivateFieldGet(this, _AnnotationEditorUIManager_viewer, "f")) === null || _a === void 0 ? void 0 : _a.classList.toggle("noUserSelect", value);
@@ -154,9 +154,9 @@ class AnnotationLayerBuilder {
154
154
  annotations,
155
155
  // imageResourcesPath: this.imageResourcesPath,
156
156
  renderForms: this.renderForms,
157
- linkService: this.linkService
157
+ linkService: this.linkService,
158
158
  // downloadManager: this.downloadManager,
159
- // annotationStorage: this.annotationStorage,
159
+ annotationStorage: this.annotationStorage
160
160
  // enableScripting: this.enableScripting,
161
161
  // hasJSActions,
162
162
  // fieldObjects,