I tried to test "Export PDF" angular on all web browsers (chrome, FireFox) it works correctly except on Internet Explorer 11
//******************************************".html"******************************************//
<button title="{{'purchase request'| translate}} PDF" mat-button class="header-button"
(click)="downloadPdf(prPurchaseRequest)">
<mat-icon>cloud_download</mat-icon>{{'purchase request'|translate}} PDF
</button>
//******************************************".ts"******************************************//
/**
*
* Download PDF prPurchaseRequest
*/
downloadPdf(prPurchaseRequest) {
this.spinnerstate = true;
this.extraService.getCollection('api/pr-purchase-requests/generate_pdf/' +
prPurchaseRequest.id).subscribe((response) => {
setTimeout(() => { this.spinnerstate = false; }, 2000);
const name = prPurchaseRequest.reference + '_purchase-request.pdf';
const linkSource = 'data:application/pdf;base64,' + response.data;
const downloadLink = document.createElement('a');
downloadLink.href = linkSource;
downloadLink.download = name;
downloadLink.click();
});
}
//******************************Error Console in internet explorer **********//