1

I have been using new ActiveXObject ('AcroPDF.PDF') to detect any Adobe Reader version 7 or higher. Just recently there is update roll out on Adobe Reader. Now when I try to run that code. It just 'die'. Is anybody else experiencing the same problem? Any suggestions or idea are welcome.

Thanks in advance,

Note: IE8. Adobe Reader X. Windows XP.

Giulio Caccin
  • 2,962
  • 6
  • 36
  • 57
Nebby
  • 43
  • 7

1 Answers1

0

Have you tried running it via CLSID rather than progId? CLSID is CA8A9780-280D-11CF-A24D-444553540000, if I'm not mistaken.

And maybe you can clarify what does 'die' mean?


Update

var checkAdobeReaderAvailability = function (displayMessageDelegate) {
            var dynamicObject = document.createElement("object");
            dynamicObject.onreadystatechange = function (x) {
                if (dynamicObject.readyState === 4) {
                    if (displayMessageDelegate !== undefined && typeof displayMessageDelegate === 'function') {
                        displayMessageDelegate();
                    }
                }
            }
            dynamicObject.classid = 'CLSID:CA8A9780-280D-11CF-A24D-444553540000';           

            document.getElementById('host').appendChild(dynamicObject)
        }

        var checkAdobeReaderAvailabilityWithProgId = function (displayMessageDelegate) {
            var ax = new ActiveXObject('AcroPDF.PDF');

            displayMessageDelegate(ax);
        }
        var onload = function () {
            checkAdobeReaderAvailability(function () { alert('Done!'); });
            checkAdobeReaderAvailabilityWithProgId(function () { alert('Done!'); });
        }
Arthur P
  • 1,050
  • 9
  • 16
  • Not sure what you mean by CLSID. Sorry for not clarifying this more. I am using Javascript to detect Adobe Reader by calling new ActiveXObject ('AcroPDF.PDF'). It was working for me before but not after the latest update of Reader. What I mean by 'die' is that I have alert function that gives me indicator of ActiveXObject but now the alert gives me null instead of object. – Nebby Jun 24 '11 at 20:01
  • There are two general ways to instantiated ActiveX manually - one is that you used - through progId. ProgId for Adobe PDF X is AcroPDF.PDF, just checked it. But something might be going on wrong with plenty of factors (security, registry etc), so you might want to choose the other option to call activex. Create OBJECT DOM element (hidden) on a page, and set the attribute classid to the GUID i sent. Please let me know if you need a code snippet to give it a try. – Arthur P Jun 24 '11 at 20:11
  • I see. I did not know you can check by using GUID. Can the guid be different from one PC to another? or from IE versions (say IE7 to IE8 to IE9). But I would like to get the code snippet. That will be very helpful. Thank you. – Nebby Jun 24 '11 at 20:17
  • OK, i posted some code. Unfortunately, I don't have XP and tried on Win7. Both invokes work fine. CLSID is the released version of COM library, yet it's better to look for progId as you did, because if there is an update, CLSID will likely change (at least that's what we usually did to ensure all consumers will be updated with new ActiveX version). Hope it will resolve the issue. – Arthur P Jun 24 '11 at 20:47
  • Thank you very much. It is always "Good Times" with IE. – Nebby Jun 24 '11 at 20:59