Search code examples
javascriptadobeversionacrobat

How to know what version of Adobe Acrobat is in my browser?


I have already the code for Adobe detection but, I need to know which version of Adobe Acrobat I have in my browser.

    <script>
    var p; // variable local para detectar el acrobat 
    var compatibleadobeacrobat=false; // variable booleana del detector acrobat
    try { 
    p = new ActiveXObject('AcroExch.Document'); 
    } 
    catch (e) { 


    // active x object could not be created 
    document.write('<img src="imagenes/iconos_VX_s2.png" width="26" height="20">');
    compatibleadobeacrobat=false; 
    document.write("<br>compatible: "+compatibleadobeacrobat);
    } 
    if (p){ 
    document.write('<img src="imagenes/iconos_VX_s1.png" width="26" height="20">'); 
    compatibleadobeacrobat=true;
    document.write("<br>compatible: "+compatibleadobeacrobat);
    }
    </script>   

Solution

  • How about using navigator's property plugins to get plugins array and after finding Adobe Reader, recieve version from it's version property?

    I don't know how Adobe Reader add-on is called, so this code is untested but it should work.

    var pl = navigator.plugins;
    
    if(pl)
    {
      var where = 0;
      for(var i=0;i<pl.length;i++)
      {
        var name = pl[i].name;
        if(name.search('Adobe PDF Reader')!=-1)
        {
          where = i;
        }
        if(where)
          break;
      } 
      var ver = pl[where].version;
    }