I am working on a projected developed using WEB API2 and AngularJS. I am created report in PDF using pdfmake.js. It works fine for Firefox. But for security reason, I like to restrict the user to use Internet Explorer. Because I need to identify the user terminal using MAC Address.
So I commanded users to use Internet Explorer. In Internet explorer, When I want to open the PDF new tab, PDFMake.js getting error on following line:
Document.prototype.open = function(message) {
// we have to open the window immediately and store the reference
// otherwise popup blockers will stop us
var win = window.open('', '_blank');
try {
this.getDataUrl(function(result) {
win.location.href = result;
});
} catch(e) {
win.close();
throw e;
}
};
The line win.location.href = result;
generating error :
Unhandled exception at line 110, column 8 in http://localhost:19884/Scripts/pdfmake/pdfmake.js 0x8007007a - JavaScript runtime error: unknown exception
I googled and didn't get any solution of this problem.
Following are the things which can solve the issue -
window.location.href
instead.document.location.href
insteadAlso read this link for more
User contributions licensed under CC BY-SA 3.0