Quantcast
Channel: Internet Explorer Web Development forum
Viewing all articles
Browse latest Browse all 3527

How to download PDF in IE and Edge?

$
0
0

IE and Edge don't supportURL.createObjectURL()when downloading PDFs. IE and Edge have their own APIs for creating and downloading files, which are calledmsSaveBlobor msSaveOrOpenBlob.

The difference between themsSaveBloband msSaveOrOpenBlobmethods is that the former only provides aSave button to the user whereas the later provides both aSave and anOpen button. We could use them like this in IE and Edge:

window.navigator.msSaveOrOpenBlob(blobData, fileName); 

To make it cross browser, the code is like below:

if(window.navigator.msSaveOrOpenBlob) 
{    
    //IE11 & Edge
    window.navigator.msSaveOrOpenBlob(blobData, fileName); 

}else{    
    //Other browsers
     Window.URL.createObjectURL(blobData);   
    ...
}




Viewing all articles
Browse latest Browse all 3527

Trending Articles