Download PDF from cache for IE10 / IE11
IE9 falls back to downloading from the original URL.
This commit is contained in:
parent
84ae29c21d
commit
e583070deb
@ -1015,11 +1015,20 @@ var PDFView = {
|
|||||||
this.pdfDocument.getData().then(
|
this.pdfDocument.getData().then(
|
||||||
function getDataSuccess(data) {
|
function getDataSuccess(data) {
|
||||||
var blob = PDFJS.createBlob(data.buffer, 'application/pdf');
|
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);
|
var blobUrl = URL.createObjectURL(blob);
|
||||||
triggerSaveAs(url, blobUrl);
|
triggerSaveAs(url, blobUrl);
|
||||||
},
|
},
|
||||||
noData // Error occurred try downloading with just the url.
|
noData // Error occurred try downloading with just the url.
|
||||||
);
|
).then(null, noData);
|
||||||
},
|
},
|
||||||
|
|
||||||
fallback: function pdfViewFallback() {
|
fallback: function pdfViewFallback() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user