mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 07:08:08 +02:00
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
1 changed files with 10 additions and 1 deletions
|
@ -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() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue