Tuesday, January 18, 2011

Detect the Adobe Reader Plugin

Recently I had to be able to detect the Adobe Reader Plugin in Javascript. I have included the code I used to flag if the Adobe Reader Plugin is installed, as well as get the version of the current adobe reader plugin. This code will detect:

  • Adobe Reader Plugin for Firefox
  • Adobe Reader Plugin for IE ( <5 and 5+)
  • Adobe Reader Plugin for Chrome and
  • WebKit PDF Reader for Safari
  • The PDF Reader for Chrome (Chrome's default alternative to the Adobe Reader Plugin)
  • Adobe Reader Plugin for most other browsers

To call it in javascript:

var info = getAcrobatInfo();
alert(info.browser+ " " + info.acrobat + " " + info.acrobatVersion);