PDF cannot be seen on IE11/10/9 recently

2.3k views Asked by At

i am a web developer in a company.
From this week on, all the colleagues around me and the web customers cannot open the embedded pdf data any more.
The way we transfer data protocol, data:application/pdf example can be found in plunker http://embed.plnkr.co/Bjkypkht4RjIWE1AyFP0/index.html
Shortly, we put data in data:application/pdf and use window.open() method to open the pdf binary data in browsers.
This function works normally before this week, it in fact works for almost one year already in both IE/Firefox/Chrome browsers with pdf add-on or viewer plugins.

But this week on, all IE versions does not work any more, error shows as following, can anyone help me to find out the reason?

Error displayed by IE:
The webpage cannot be displayed
Most likely cause:
Some content or files on this webpage require a program that you don't have installed.


Please do not tell me to reset IE or enable/disable IE, all these methods have been tried by us but didn't work. Thanks

Operating System:
Windows 7 Professional 64 bit

IE11(take this as an example):
Version: 11.0.9600.17728
Update Versions: 11.0.18(KB3038314)

Adobe PDF:
Name:                   Adobe PDF Reader
Publisher:              Adobe Systems, Incorporated
Type:                   ActiveX Control
Architecture:           32-bit and 64-bit
Version:                11.0.10.32
File date:              ‎Tuesday, ‎December ‎02, ‎2014, ‏‎10:31 PM
Date last accessed:     ‎Today, ‎June ‎04, ‎2015, ‏‎2 hours ago
Class ID:               {CA8A9780-280D-11CF-A24D-444553540000}
Use count:              1
Block count:            0
File:                   AcroPDF64.dll
Folder:                 C:\Program Files (x86)\Common Files\Adobe\Acrobat\Active
1

There are 1 answers

0
Xiaoqiang Wang On BEST ANSWER

This is my verified code snippets using javascript.

            //create a Blob with an array and the optional dictionary object.
            var TEST_PDF_DATA = data;
            var byteCharacters = atob(TEST_PDF_DATA);

            var charCodeFromCharacter = function(c) { return c.charCodeAt(0); }
            var byteArrays = [];
            for (var offset = 0; offset < byteCharacters.length; offset += 1000)
            {
                var slice = byteCharacters.slice(offset, offset + 1000);
                var byteNumbers = Array.prototype.map.call(slice, charCodeFromCharacter);
                byteArrays.push(new Uint8Array(byteNumbers));
            }

            var blob1 = new Blob(
                byteArrays, //array
                { type: "application/pdf"} //dictionary object
            );

            //create a second blob that uses the first blob in its array
            var blob2 = new Blob([blob1, "Those who understand binary and those who don't."]);

            // Save the blob2 content to a file, giving both "Save" *and* "Open" options
            window.navigator.msSaveOrOpenBlob(blob2, 'msSaveBlobOrOpenBlob_testFile.pdf');
            alert('File saved using msSaveOrOpenBlob() - note the two "Open" and "Save" buttons below.');