Hi! Im facing a issue with PdfViewer component in angular; i want to set downloadFileName as a property of component but on init component, this value is being removed; i was debugging in ej2-pdfviewer.es.2015.js and the function clear(triggerEvent) is removing downloadFileName property, being null after init.
The way that i found to set the correct name to downloaded file is catch downloadStart and set pdfViewer.downloadFileName again but i think that is not clean perspective:
ah ok, I found the issue, I deactivate change detection strategy of container component of pdfViewer component, and if i change from onPush to default, i can set downloadFileName.
Regards
<ejs-pdfviewer id="pdfViewer" [serviceUrl]='service' [documentPath]='document'
(downloadStart)="downloadStart($event)" style="height:640px;display:block">
</ejs-pdfviewer>
downloadStart() {
var viewer = (<any>document.getElementById('pdfViewer')).ej2_instances[0];
viewer.downloadFileName = 'syncfusion.pdf';
}
|