I receive (from a webservice I don\'t manage) a string with the content of a pdf file.
On client\'s side, I use this function:
window.open(\'data:application
Update Reader or Acrobat
Adobe releases free security updates quarterly. Make sure you update your version of Reader or Acrobat to the latest release. The updates often include fixes to common problems. Download the latest free update.
Open Reader or Acrobat. Choose Help > Check for Updates.
Acrobat 9 and earlier: If a new update is available it installs automatically.
Acrobat X and XI: Click Update and then click Install.
Acrobat DC: Continue to the next step. Check for updates When the Updater dialog box appears, click Download.
Update Acrobat After download is complete, click the Acrobat install icon. In the Acrobat Updater window, click Install. Update is Ready After installation is complete, restart your computer and test the PDF again to see if you can view it.
PDF solutions
Refresh or reload the page
Often, just refreshing the page in your browser allows the PDF to load fully.
Hold down the Shift key and press the Refresh or Reload button in the browser. Try to view a different PDF
Try viewing a different PDF. For example, see if this sample form displays in your browser. If Acrobat or Reader can open the sample form, then the other PDF could be damaged or the web server could be having problems. If possible, contact the individual or company who manages the website.
Try to view a PDF on your hard drive
Determine if your web browser can open a PDF from your local hard drive rather than from the web. For this test, you need a PDF saved on your computer.
In your web browser, do one of the following:
Mac OS: Choose File > Open (or Open File). Windows: Press Control+O. Click Browse.
(Windows only) From the Files Of Type menu, choose All Files. Choose all files Locate a PDF on your computer, select it, and then click Open. If the PDF opens, the website you were viewing could have a problem. Contact the individual or company who manages the website.
I found the solution and I want to share anyone who has the same problem. You can see the demo here : https://jsfiddle.net/quangminh_ln/hy36tnt6/
'use strict';
var data = "...Your PDF base64 string...";
var fileName = "your_file_name";
if (window.navigator && window.navigator.msSaveOrOpenBlob) { // IE workaround
var byteCharacters = atob(data);
var byteNumbers = new Array(byteCharacters.length);
for (var i = 0; i < byteCharacters.length; i++) {
byteNumbers[i] = byteCharacters.charCodeAt(i);
}
var byteArray = new Uint8Array(byteNumbers);
var blob = new Blob([byteArray], {type: 'application/pdf'});
window.navigator.msSaveOrOpenBlob(blob, fileName);
}
else { // much easier if not IE
window.open("data:application/pdf;base64, " + data, '', "height=600,width=800");
}
The link that I saw for my solution : https://viethoblog.wordpress.com/2016/08/30/loaddisplay-pdf-from-base64-string-bonus-ie-workaround/