Detecting if client has any kind of PDF reader installed
<p>I'm trying to do a naive detection of whether a PDF reader is installed on a given webpage; if it is, I will allow the installed reader to view the pdf in an iframe, if not I use an embedded google viewer. </p>

<p>I'm not necessarily interested in a 100% fool proof solution, but something that will catch the vast majority of users. When I do detect a pdf reader is installed, I do want to be absolutely certain.  If you have something weird installed, you probably already know how to download the actual pdf if you want.</p>

<p>I'm assuming I want to determine which browser the user is viewing. Once I have that are there any cheap shortcuts or assumptions I can use?</p>

<p>I know I can do this for IE, but what about for Firefox or Chrome?:</p>

<pre><code>   var installed;

   try
   {
    installed = new ActiveXObject('AcroPDF.PDF');
   }
   catch (e){}

   if (!installed)
   {
    try
    {
     // Older Ie
     isntalled = new ActiveXObject('PDF.PdfCtrl');
    }
    catch (e) {}
   }

   return installed;
</code></pre>
