nuxeo-development-framework 1.6.4 → 1.6.5

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.
@@ -18817,20 +18817,31 @@
18817
18817
  img: '<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" class="bi bi-file-earmark-arrow-down" viewBox="0 0 16 16"> <path d="M8.5 6.5a.5.5 0 0 0-1 0v3.793L6.354 9.146a.5.5 0 1 0-.708.708l2 2a.5.5 0 0 0 .708 0l2-2a.5.5 0 0 0-.708-.708L8.5 10.293V6.5z"/> <path d="M14 14V4.5L9.5 0H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2zM9.5 3A1.5 1.5 0 0 0 11 4.5h2V14a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h5.5v2z"/></svg>',
18818
18818
  title: 'Download',
18819
18819
  onClick: function () {
18820
- var url = _this.correspondance.properties.content.data;
18821
- var fileName = _this.correspondance.properties.content.name;
18822
- if (url && fileName) {
18823
- var safeUrl = _this.securePipe.transform(url);
18824
- safeUrl.subscribe(function (url) {
18825
- var link = document.createElement('a');
18826
- link.style.display = 'none';
18827
- link.href = url.changingThisBreaksApplicationSecurity;
18828
- link.download = fileName;
18829
- document.body.appendChild(link);
18830
- link.click();
18831
- document.body.removeChild(link);
18832
- });
18833
- }
18820
+ var _a = _this.webViewerInstance.CoreControls, DocumentViewer = _a.DocumentViewer, AnnotationManager = _a.AnnotationManager, SaveOptions = _a.SaveOptions;
18821
+ // const xfdfString = await AnnotationManager.exportAnnotations();
18822
+ var saveOptions = SaveOptions;
18823
+ var options = {
18824
+ filename: _this.correspondance.title ? _this.correspondance.title : 'myDocument.pdf',
18825
+ // xfdfString,
18826
+ flags: saveOptions.LINEARIZED,
18827
+ downloadType: 'pdf'
18828
+ };
18829
+ _this.pdftronService.instance.downloadPdf(options);
18830
+ // this.events.next('download');
18831
+ // let url = this.correspondance.properties.content.data;
18832
+ // let fileName = this.correspondance.properties.content.name;
18833
+ // if (url && fileName) {
18834
+ // let safeUrl = this.securePipe.transform(url);
18835
+ // safeUrl.subscribe((url: any) => {
18836
+ // const link = document.createElement('a');
18837
+ // link.style.display = 'none';
18838
+ // link.href = url.changingThisBreaksApplicationSecurity;
18839
+ // link.download = fileName;
18840
+ // document.body.appendChild(link);
18841
+ // link.click();
18842
+ // document.body.removeChild(link);
18843
+ // });
18844
+ // }
18834
18845
  },
18835
18846
  });
18836
18847
  });