ng2-pdfjs-viewer
ng2-pdfjs-viewer copied to clipboard
How to download PDF by using external button?
I have a requirement to download the PDF on button click, but i don't want to use the in-built download button.
I found the solution how can do it using below code
this.pdfViewer.startDownload = true; this.pdfViewer.refresh(); this.pdfViewer.startDownload = false;
But it reloads the PDF which is not good, is there a way i can download without refresh() ?
@kiranhpe Just use plain old jQuery or Javascript and do a click() trigger on the viewer's download button.
See a sample here : https://stackoverflow.com/questions/3560227/jquery-javascript-trigger-button-click-from-another-button-click-event