Download PDF from cache for IE10 / IE11

IE9 falls back to downloading from the original URL.
This commit is contained in:
Rob Wu 2013-07-10 22:07:23 +02:00
parent 84ae29c21d
commit e583070deb

View File

@ -1015,11 +1015,20 @@ var PDFView = {
this.pdfDocument.getData().then(
function getDataSuccess(data) {
var blob = PDFJS.createBlob(data.buffer, 'application/pdf');
//#if GENERIC
if (navigator.msSaveBlob) {
// IE10 / IE11
if (!navigator.msSaveBlob(blob, getPDFFileNameFromURL(url))) {
noData();
}
return;
}
//#endif
var blobUrl = URL.createObjectURL(blob);
triggerSaveAs(url, blobUrl);
},
noData // Error occurred try downloading with just the url.
);
).then(null, noData);
},
fallback: function pdfViewFallback() {