If you’ve ever had the need to determine what version of the Acrobat Browser Plugin your web visitors are using then perhaps we can shed some light on how to find this information.
As the ActiveX Control (pdf.ocx) is undocumented and unsupported by Adobe Tech Support, programming with it can be wasted effort.
The other thing to note is that Internet Explorer and Netscape Navigator provide this information in two totally different ways — surprise, surprise 😉
To find out the version of Acrobat being used inside Internet Explorer we need to create an Object from the ‘pdf.ocx‘ ActiveX control.
To accomplish this we need to know the Class ID of the Object we are to embed. Using Microsoft’s ActiveX Control Pad you can easily do this (see references at the bottom of the page). Alternatively you can look in the registry against the PDF.PdfCtrl.6 entry (CLSID).
The Class ID for the pdf.ocx for Acrobat 5/6 is:
The ClassID for earlier versions may be the same, but as I no longer have these version installed I’m unable to find this out.
In a normal HTML page we add the following Tag:
I generally put these right after the BODY tag so they are processed first as the browser parses the HTML.
Once the page is processed you will have a reference to the ActiveX Control (pdf.ocx) by using the object name ‘Pdf1‘.
In brief we basically ask the ‘Pdf1‘ object to give us a list of the version numbers (GetVersions()), we can then do a quick check to see if this information has the numbers 6.0.0 or 5.0.0 (an also the updaters (5.0.5 and 6.0.1).
That code could be as simple as:
if(Pdf1.GetVersions().indexOf('6.0') != -1)
alert('Acrobat 6 Found')
As I mentioned before NN has a different approach when it comes to plugins.
There’s an object in Netscape to provide access to plugins, it works like this:
var pluginName = navigator.plugins['Adobe Acrobat'].description;
if(pluginName.indexOf('6') != -1)
alert('Acrobat 6 Found')
Because there’s no ActiveX object to reference we can simply put this code (and obviously more) into a function and call it from an onLoad or onClick event handler.
Hopefully the code listings and the explanations should be enough to get you started, the Adobe Acrobat TechDoc listed in the reference section may also help.
- ActiveX Explorer
http://www.alteviltech.com – This application provides very detailed information for Type Libraries, ActiveX Components and other Windows components.
- MS ActiveX Control Pad (Free)
The ActiveX Control Pad, inserts the ClassID for the Browser PDF Control (pdf.ocx). It’s also capable of showing the Procedures and Functions available in any ActiveX control.
- Adobe TechNote #51621
This technote formed the basis for this article.
- Example HTML File Complete
Code also listed below