问题
As the tile suggest, I am trying to print a PDF report specifically on IE 11. The following snippet of code works will in chrome, but when it come to IE11, all hell breaks loose; nothing works. To give you a background, I am developing Angular 5 reporting application. Here the user can view, download and print the report. I was able to achieve all the above functionalities except for printing on IE 11!
const iframe = document.createElement('iframe');
iframe.style.display = 'none';
iframe.src = window.URL.createObjectURL(new Blob([result], { type: 'application/pdf' }));
document.body.appendChild(iframe);
iframe.contentWindow.print();
Any input is appreciated.
来源:https://stackoverflow.com/questions/50685552/print-pdf-report-in-ie-11