• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Opening PDF in IE 8/IE 9 with Adobe plugin 10.1.2.X - workaround

Community Beginner ,
Feb 07, 2012 Feb 07, 2012

Copy link to clipboard

Copied

Hi,

After update my Adobe Reader to latest one (10.1.2.45) I started to have problems with opening PDF files directly in IE 8/IE 9.

Problem background:


I have a JSF web application (hosted on Tomcat 6) where on a certain page I use direct link to open a certain PDF file from server. When click on the link, a JavaScript new window is opened where PDF is displayed directly. When I click on the link first time, PDF opens and it is visible. This is OK. But when I close the window and try to open it again by clicking the link (with the same file), second trial does not work - I see grey page instead of PDF. I have this problem only for IE 8 (tested from Windows XP Prof.) and IE 9 (tested from Windows 7 Professional). Both IE used for test were 32-bit. Both have Adobe plugin 10.1.2.45 installed. Recently I had for both Adobe plugin version 10.0.1.434 and it worked OK.

How to reproduce/workaround:


First I though it is something related to my application (Tomcat settings or something), because next to opening PDF in new popup JavaScript window, my application also displays embedded PDF on pages inside <iframe> tag. Now most weird part: I discovered that problem with opening PDF inside new popup window under IE8 /IE 9 occurs only when I previously displayed any PDF embedded on page using <iframe>!

Based on that I am able to create simple .html files where I can reproduce this issue everytime (when I put those files on a server inside any web application). I created 2 files: one of them has PDF file displayed inside <iframe> tag and has the link to the second page, where I can open PDF file using JavaScript new window. Those files are:

1.html:

<html>

<body>

<b>Page 1</b><br /><br />

<iframe src="test.pdf"></iframe>

<br />

<br />

<a href="2.html">[Page with JavaScript PDF opening (page 3)]</a>

</body>

</html>

2.html:

<html>

<head>

    <script type="text/javascript">

    // <![CDATA[   

        function showPDF(fileToShow) {   

            window.open(fileToShow,'PDFWindow','toolbar=0,menubar=0,location=0,directories=0,status=0,resizable=0');

        }

    // ]]>

    </script>

</head>

<body>

<b>Page 2</b><br /><br />

<a onclick="showPDF('test.pdf');">[Open PDF in new window with JavaScipt]</a>

</body>

</html>

Then I open the IE 8/IE 9 browser and type URL to my Tomcat server, to some web application which contains those pages (for example: http://localhost:8080/test/1.html). I see embedded PDF correctly. Then I go to the second page using the link, and on second page I click the link to open new JavaScript window with displayed PDF. As I wrote before, first opening works, but second (third, fourth,...) not (remember to close first opened popup window before open it second time).

Now some modifications to make it work (they are di):

Solution 1. Refresh second opened window with F5 - PDF is reloaded and siplayed correctly

Solution 2. Close all opened new windows from page 2.html and go back to the page 1.html where PDF is visible as embedded iframe (use browser's button "back"), then navigate again to 2.html. First click on new window works again! But second, third, fourth again not.

Solution 3. Put on page which opens new popup windows (in our case: 2.html) an embedded iframe with PDF in the same way like it was placed on 1.html. Now You can open new window with PDF many times and eveything works OK.

Solution 4. Remove from 1.html embedded <iframe> with PDF, then navigate to 2.html (or just open http://localhost:8080/test/2.html directly). Again You can open new window with PDF many times and eveything works OK.

Note: when I open those files in a browser directly from my desktop (not from server and web application) everything works OK, no matter if I have <iframe> or not on page 1.html. When I navigate between many pages that have PDFs displayed using <iframe> (no matter what is in <iframe>: direct URL to file stored on server or invoking a servlet which "produces" PDF) everything works OK, PDF are displayed. It seems that problem is only when new window is in use and some page before used an <iframe> (except page that opens those new window - see solution 3). Maybe this is something related to the security settings in IE?

Hope this helps someone.

Views

45.3K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 07, 2012 Feb 07, 2012

Copy link to clipboard

Copied

We have similar problem.

HTML page containts pdf object. This PDF is not displayed when user has combination: IE + Acrobat X + plugin version 10.1.2.45

If user uses other browser (Firefox, Chrome, etc.) or has only Reader X or has plugin older than 10.1.2.45, than PDF (as object in HTML) is displayed correctly.

It seems like some bug in plugin version 10.1.2.45

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 07, 2012 Feb 07, 2012

Copy link to clipboard

Copied

Juraj, how is Your PDF embedded in the HTML page? Do You also use popup windows opened by JavaScript, where You try to display PDF? In my case this does not work only, providing that I use somewhere before an embeded PDF as <iframe> (or <embed> or <object>).

I tried to modify my example 2.html file to add other way of embedding PDF file (by <object>, <embed>), in order to test if link [Open PDF in new window with JavaScipt] will start to work many times - like it starts when I put <iframe> here (see solution 3).

2.html:

<html>

<head>

    <script type="text/javascript">

    // <![CDATA[   

        function showPDF(fileToShow) {   

            window.open(fileToShow,'PDFWindow','toolbar=0,menubar=0,location=0,di rectories=0,status=0,resizable=0');

        }

    // ]]>

    </script>

</head>

<body>

<b>Page 2</b><br /><br />

     <a onclick="showPDF('test.pdf');">[Open PDF in new window with JavaScipt]</a>

    <br />   

    <embed src="test.pdf" width="400" height="500">

    <br />   

    <object width="400" height="500" type="application/pdf"

        data="test.pdf">

        <p>No PDF available</p>

    </object> 

</body>

</html>

Link [Open PDF in new window with JavaScipt] now again works OK for IE 8/IE 9 (providing that I navigate from 1.html where initial PDF is displayed as <iframe>) - now I can open new window with PDF many times. But I think those <embed> and <object> just behave the same like <iframe>. Probably such opening PDF again somehow "unblocks" ("reloads"?) plugin that it starts to works for every opened popup window.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 07, 2012 Feb 07, 2012

Copy link to clipboard

Copied

PDF is in HTML as object:

<object id="pdf" data="sample.pdf#toolbar=0&navpanes=0&messages=0" type="application/pdf" width="400" height="200"  style="margin: 0px; padding: 0px"></object>

I don't use IFRAME, because I need to communicate with PDF via javascript and it is possible only when PDF is as object, not in iframe.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 07, 2012 Feb 07, 2012

Copy link to clipboard

Copied

Juraj, I tried to put such <object> in a simplest page:

<html>

<body>

<object id="pdf" data="test.pdf#toolbar=0&navpanes=0&messages=0" type="application/pdf" width="300" height="400"  style="margin: 0px; padding: 0px"></object>

</body>

</html>

but it works OK everytime with my IE 8 (32-bit under Widnows XP Prof. with plugin 10.1.2.45). I tested it in sample web application under Tomcat.

How do You navigate to that page  with PDF embedded as <object>? Is this a new window opened somewhere? Maybe can You  write some simple .html files and write some advices how to test this, so I can reproduce it on my machine? Perhaps this is something similar.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 07, 2012 Feb 07, 2012

Copy link to clipboard

Copied

Well, we are using it in Win7, and PDF is interactive XFA form with scripts (so it is not just simple PDF).

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 07, 2012 Feb 07, 2012

Copy link to clipboard

Copied

Juraj, I understand. You have more complicated case than me.

Strange that in my example everything worked OK except the JavaScript link with window.open(). Even <a href="test.pdf" target="_blank"> worked OK.

It would be great if someone could take  my sample test files and check this issue. Maybe problem is somewhere with my configuration? However I tested it on two different machines (XP and 7,  both with Tomcat servers), with different IE (8 and 9), trying to log in locally and from other machine. Same result for both - it didn't work.

The only possible solution is to place hidden <iframe>/<object>/<embed> PDF on the page which contains links to the other PDF files opened with window.open() or go back to previous version of Adobe Reader X.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 08, 2012 Feb 08, 2012

Copy link to clipboard

Copied

I found another case when PDF is not shown in new window (opened with JavaScript window.open()). It seems that checking with JavaScript that Adobe Reader plugins is installed in the browser might cause problems. Let's modify sample files from my first post:

1.html:

<html>

<head>

    <script type="text/javascript">

    // <![CDATA[   

        function checkForAdobePlugin() {   

            var isAdobe = adobeDetector();

            if ((isAdobe != null) && (!isAdobe.installed)) {

                if (confirm('Adobe Reader not installed')){                       

                    return;

                }

            }

        }

        function adobeDetector() {

            // for Windows only

            if (navigator.userAgent.toLowerCase().indexOf("win") != -1) {

                var acrobat=new Object();

                acrobat.installed=false;       

                // IE

                if(navigator.userAgent.toLowerCase().indexOf("msie") > -1){

                    try {

                        // version 6 or earlier

                        oAcro=new ActiveXObject('PDF.PdfCtrl');

                        if (oAcro) {                   

                            acrobat.installed=true;                                           

                        }

                    }

                    catch(e) {}

                    try {

                        // version 7 or higher

                        oAcro7 = new ActiveXObject('AcroPDF.PDF');

                        if (oAcro7) {

                            acrobat.installed=true;                                           

                        }

                    }

                    catch(e) {}

                }       

                // check for Firefox, Chrome and others - code removed to simplify

                return acrobat;

            }

            // other OS (not supported)

            return null;

        }

    // ]]>

    </script>

</head>

<body onload="checkForAdobePlugin();">

<b>Page 1</b><br /><br />

<br />

<br />

<a href="2.html">[Page with JavaScript PDF opening (page 3)]</a>

</body>

</html>

2.html (no changes here):

<html>

<head>

    <script type="text/javascript">

    // <![CDATA[   

        function showPDF(fileToShow) {   

            window.open(fileToShow,'PDFWindow','toolbar=0,menubar=0,location=0,directories=0,status=0,resizable=0');

        }

    // ]]>

    </script>

</head>

<body>

<b>Page 2</b><br /><br />

<a onclick="showPDF('test.pdf');">[Open PDF in new window with JavaScipt]</a>

</body>

</html>

Description:

Only page 1.html is modified. I do not use here any <iframe> with PDF, which causes problems opening PDFs with JavaScript from 2.html page like I described in first post. Instead I added JavaScript method invoked when loading the page 1.html, which checks if Adobe Reader plugin is installed in the browser (for simplify only code for checking IE is shown). It seems that executing this JavaScript function when using IE 8/IE 9 also causes that PDFs cannot be opened from 2.html page more than one. Moreover it seems that piece of code checking for Adobe Reader 7 or higher is responsible for that problem:

     oAcro7 = new ActiveXObject('AcroPDF.PDF');

     if (oAcro7) {

         acrobat.installed=true;                                           

     }

This part of code is executing without any errors in IE 8/IE 9 and finds installed PDF plugin (acrobat.installed is set to true), but causes Adobe Plugin not to respond when trying to open new popup window with embedded PDF. When I remove this piece of code, everything works OK in IE 8/IE 9. Again this happens only for Adobe Reader plugin version 10.1.2.X installed. Workarounds are the same I put in first post. Of course this does not work when I put those files in web application - opening files in IE directly from hard disk works OK.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Feb 09, 2012 Feb 09, 2012

Copy link to clipboard

Copied

Hi,

I think this issue is known issue. See 10.1.2 release notes at: kb2.adobe.com/cps/837/.../Acrobat_Reader_ReleaseNote_10.1.2.pdf

Hope Adobe will come up with some kind of fix.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Feb 16, 2012 Feb 16, 2012

Copy link to clipboard

Copied

Hi All,

Try this hotfix and check after rebooting the machine:

http://kb2.adobe.com/cps/930/cpsid_93026.html

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 22, 2012 Feb 22, 2012

Copy link to clipboard

Copied

this hotfix has fixed an out standing isue that we where having. Thanks.

Do you know if this was just released? and if it will be included in the next release say 10.1.3.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Feb 22, 2012 Feb 22, 2012

Copy link to clipboard

Copied

Hi,

Hotfix has been releases after 10.1.2 release.

In the past, all hotfixes were inlcuded in next release, so I think this time also it will be included in 10.1.3

-NIkhil

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 05, 2012 Oct 05, 2012

Copy link to clipboard

Copied

Has this issue been reintroduced in 10.1.4? I've run into the issue where PDFs will not open when using window.open on IE8 WIN7. I did not have a problem when using IE8 and XP.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 26, 2012 Nov 26, 2012

Copy link to clipboard

Copied

LATEST

I am noticing this again as well with Win7, IE8-10, and Adobe plugin 10.1.4.38.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 05, 2012 Mar 05, 2012

Copy link to clipboard

Copied

I confirm - hotfix works.

I tested it under IE 8/IE 9 for both cases described by me before, where I was able to reproduce the problem. Now everything works OK. We are waiting for next version where this hotfix will be included.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines