|
991 | 991 | ieVersion = this.isIE();
|
992 | 992 | var doc = pdfMake.createPdf(docDefinition);
|
993 | 993 | var blob;
|
| 994 | + |
994 | 995 | doc.getBuffer( function (buffer) {
|
995 | 996 | blob = new Blob([buffer]);
|
996 |
| - }); |
997 | 997 |
|
998 |
| - if (ieVersion && ieVersion < 10) { |
999 |
| - var frame = D.createElement('iframe'); |
1000 |
| - document.body.appendChild(frame); |
| 998 | + if (ieVersion && ieVersion < 10) { |
| 999 | + var frame = D.createElement('iframe'); |
| 1000 | + document.body.appendChild(frame); |
1001 | 1001 |
|
1002 |
| - frame.contentWindow.document.open("text/html", "replace"); |
1003 |
| - frame.contentWindow.document.write(blob); |
1004 |
| - frame.contentWindow.document.close(); |
1005 |
| - frame.contentWindow.focus(); |
1006 |
| - frame.contentWindow.document.execCommand('SaveAs', true, fileName); |
| 1002 | + frame.contentWindow.document.open("text/html", "replace"); |
| 1003 | + frame.contentWindow.document.write(blob); |
| 1004 | + frame.contentWindow.document.close(); |
| 1005 | + frame.contentWindow.focus(); |
| 1006 | + frame.contentWindow.document.execCommand('SaveAs', true, fileName); |
1007 | 1007 |
|
1008 |
| - document.body.removeChild(frame); |
1009 |
| - return true; |
1010 |
| - } |
| 1008 | + document.body.removeChild(frame); |
| 1009 | + return true; |
| 1010 | + } |
1011 | 1011 |
|
1012 |
| - // IE10+ |
1013 |
| - if (navigator.msSaveBlob) { |
1014 |
| - return navigator.msSaveBlob( |
1015 |
| - blob, fileName |
1016 |
| - ); |
1017 |
| - } |
| 1012 | + // IE10+ |
| 1013 | + if (navigator.msSaveBlob) { |
| 1014 | + return navigator.msSaveBlob( |
| 1015 | + blob, fileName |
| 1016 | + ); |
| 1017 | + } |
| 1018 | + }); |
1018 | 1019 | },
|
1019 | 1020 |
|
1020 | 1021 |
|
|
0 commit comments