Adobe PDF Reader Plugin Detector




A few PluginDetect commands for Adobe Reader detection

PluginDetect.getVersion('AdobeReader'): [Returns string or null]
   Returns the version (as a string) of the installed Adobe Reader plugin. When getVersion() returns a version, it only means that the plugin is installed. It does NOT necessarily mean that the plugin is enabled.
   Returns null when the version could not be determined (when plugin is not installed/not enabled, or plugin is installed but the version information is unavailable).

By default, the returned version string is comma delimited and has the format of "A,B,C,D". If you wish to change the getVersion() delimiter, then use:
   PluginDetect.getVersion(delimiter) where delimiter is a string with exactly 1 character.

For example,
   PluginDetect.getVersion(".");   // set delimiter
   var version = PluginDetect.getVersion("AdobeReader");    // version has the format of "A.B.C.D"


PluginDetect.isMinVersion('AdobeReader', minVersion):
[Returns number]

   Returns 1 if plugin is installed & enabled and plugin version is >= minVersion. You can view PDF documents by using the browser (with the plugin) and/or by using the standalone Adobe Reader application [depending on the browser settings and the standalone application settings].
   This detection result does NOT guarantee that the Adobe Reader plugin is the default PDF viewer in the browser, however. It is possible that the browser may have other PDF viewer(s) installed, and that the browser will simply use one of those other viewers instead of Adobe's. Again, this depends on the browser preferences/settings, etc...
   Trying to detect when the Adobe plugin is the default PDF viewer across all browsers, all platforms, and all possible configurations is impractical at best. There are too many problems in trying to detect this.
   However, it is possible to detect when Firefox's native PDF Reader is the default in Firefox. So any conflict between the Adobe plugin and the Firefox PDF Reader can be revealed by specifically trying to detect the Firefox PDF Reader. Or better yet, we can combine the Adobe PDF and the Firefox PDF detectors.

   Returns 0 if plugin is installed & enabled. The plugin version is unknown, and thus we are unable to determine if version >= minVersion. You can view PDF documents using the browser (with the plugin) and/or the standalone application [depending on the browser settings and the standalone application settings.]
[Note: this detection result does NOT guarantee that Adobe Reader is the default PDF viewer in the browser.]

   Returns -0.1 if plugin is installed & enabled, but plugin version is < minVersion. You can view PDF documents using the browser (with the plugin) and/or the standalone application [depending on the browser settings and the standalone application settings.]
[Note: this detection result does NOT guarantee that Adobe Reader is the default PDF viewer in the browser.]

   Returns -0.15 (Internet Explorer only) if plugin is installed but not enabled for <object>/<embed> tags. The plugin version cannot be detected. The browser + Adobe plugin are unable to use <object>/<embed> tags to display PDF documents. This result occurs for Internet Explorer when the Adobe Reader ActiveX control is disabled in the add-ons menu.
   However, for Internet Explorer and Adobe Reader 10 (and lower), a PDF document can still be displayed in the browser window. Apparently the ActiveX control is not needed in this case.
   For Internet Explorer and Adobe Reader 11 (and higher), PDF documents will not display in the browser window when the ActiveX control is disabled. Instead, the PDF is downloaded by the browser, and then the standalone Adobe application starts up to display the PDF.
   So for this detection result, depending on the browser settings and the standalone application settings and the Adobe Reader version, a PDF document can be viewed in the browser (with the plugin) and/or in the Adobe Reader standalone application.
[Note: this detection result does NOT guarantee that Adobe Reader is the default PDF viewer in the browser.]

   Returns -1 if plugin is not installed / not enabled. You cannot view PDF documents in the browser with this particular plugin because the Adobe plugin is not installed / not enabled. There are several possible reasons for this detection result:
  1) The Adobe Reader software is not installed on your computer.
  2) The Adobe Reader software is installed on your computer, but it is disabled in your browsers settings/preferences. For example, in Firefox you can disable the plugin completely, and so the Adobe Reader plugin + Firefox browser will be unable to display PDF documents. However, the user can still download PDF docs and view them in the Adobe Reader standalone application.
  3) The Adobe Reader software is installed on your computer, but within the Adobe standalone application preferences, the "Display in Browser" option is disabled. In this case, the Adobe plugin is disabled and will not display any PDF docs within the browser. It is not possible to detect the plugin either. But the standalone app itself naturally can still display PDF docs. [Note: for Adobe Reader 11 and higher, it appears that the "Display in Browser" option is no longer present in the Adobe standalone preferences.]

   Returns -1.5 (Internet Explorer only) if plugin status is unknown. ActiveX is disabled and/or ActiveX Filtering is enabled in the browser, and therefore it is not possible for PluginDetect to determine if the Adobe Reader plugin is installed or not.
   If the Adobe plugin is installed, then the browser + Adobe plugin will be unable to use <object>/<embed> tags to display PDF documents. However, the browser + Adobe plugin may still be able to display PDF documents in the browser window itself.

   Returns -3 if you supplied a bad input argument to the isMinVersion() method.


minVersion: [string or number input argument]
   This is the minimum plugin version.
   Can be a string such as  '1,5,0,0' or '1.5' or '1,5,0,1' or '1.5.0.1' etc...
   Can be a number such as 0 or 1.5 or 1.50 etc...
   If minVersion is not specified, then PluginDetect will assume minVersion is '0'.
   Strings are more versatile than numbers since '1,5,0,1' cannot be expressed as a number.




Limitations of Adobe Reader detection

When you install Adobe Reader on your computer, you have 2 ways of viewing PDF documents:

i) You can use the standalone Adobe Reader application to view PDF documents.

or

ii) You can use a browser with the Adobe Reader plugin to view PDF documents. A PDF document can appear directly inside the browser window, or inside a web page via a <frame> tag/<iframe> tag/<object> tag/<embed> tag.


The problem here is that PluginDetect can only detect the plugin itself. It cannot detect the standalone application. (But the presence of the plugin implies the presence of the standalone)

For example, a user may adjust the Adobe Reader preferences and the browser settings so that the plugin is totally disabled. In this case, PluginDetect will not be able to detect the Adobe Reader plugin, yet the user will still be able to view PDF documents in the standalone application.



There could be multiple PDF Readers in your browser


There are a number of different PDF Reader plugins that can display a pdf document in your browser. To name a few: Adobe Reader, Foxit Reader, Nitro Reader, Chrome viewer (native), PDF.js (native to Firefox), and others.

The problem here is that installing the Adobe Reader on your system is not a guarantee that your browser will automatically use the Adobe plugin when displaying a pdf. For example, your Firefox browser may use PDF.js instead of the Adobe Reader plugin. To insure that your browser actually uses the Adobe plugin, you may have to disable any other PDF readers that are integrated with your browser.

At this point, I am not sure there is a reliable cross-browser/cross-platform way for PluginDetect to determine if the Adobe plugin is the default viewer that will be used by your browser vs. some other random PDF viewer. [However, it does appear to be possible to detect when the PDF.js viewer is the default viewer in Firefox. So any conflict between the Adobe plugin and PDF.js in Firefox can be resolved by detecting PDF.js.]



Plugin Version Precision

The precision of the detected Adobe Reader version will vary greatly between browsers. The reason for this discrepancy is that the amount of information available to PluginDetect varies between browsers and operating systems.

The plugin version is detected by PluginDetect.getVersion('AdobeReader'). The getVersion() method will return a value of either null or a string of 4 numbers "A,B,C,D" separated by a comma. Each of these 4 numbers is an integer >=0.

For Internet Explorer, the first 3 numbers "A,B,C" can be detected. For all other browsers, the precision can range from only being able to detect the first number "A", to being able to detect all 4 numbers "A,B,C,D".

The only time (so far) I have seen all 4 numbers "A,B,C,D" available is for Firefox 3.6+ on Windows.



Detecting Reader for Firefox/Chrome/Safari and other non-IE browsers

For Adobe Reader 8.0 thru 9.3 on Windows/non-IE browsers, the plugin version is not directly detectable. PluginDetect can, however, deduce the first digit of the plugin version by looking at all available information within the browser. The format of this deduced version will be "A,0,0,0". [Note: Firefox 3.6+ appears to be the exception. It allows all 4 digits "A,B,C,D" of the plugin version to be detected, regardless of the Adobe Reader version.]

For Adobe Reader < 8.0 and >=5.0, and Adobe Reader 9.3.3 or higher, on Windows/non-IE browsers, the plugin version is detectable. The format of the detected version will be "A,B,C,0".

For Adobe Reader/Macintosh, it appears that the plugin version can be detected as "A,B,C,0" (at least for Reader 7+).

For Adobe Reader/Linux, it appears that the plugin version can be detected as "A,B,0,0".



Select minVersion input argument with care

Please note again that the number of digits that can be detected for the Adobe Reader version will vary. In some cases, the format will be "A,0,0,0", and in others the format will be "A,B,C,D". Therefore, you need to specify the 'minVersion' input argument to PluginDetect.isMinVersion("AdobeReader", minVersion) very carefully.

In the case of Adobe Reader 8 - 9.3 in Windows/non-IE browsers, we have already shown you that the version is only detectable as "A,0,0,0". So, Adobe Reader 8.2 would be detected as "8,0,0,0" and Adobe Reader 8.0 would be detected as "8,0,0,0". Adobe Reader 9.3 would be detected as "9,0,0,0" and Adobe Reader 9.0 would be detected as "9,0,0,0".

So be careful when specifying 'minVersion'.



Detecting Reader for Internet Explorer

For Internet Explorer, the plugin version appears to be detectable for Adobe Reader 5+. The plugin version will have the format of "A,B,C,0".






Top of Page