2

How can i check with php or js, if client browser for adobe reader plugin is installed?

Faraona
  • 1,685
  • 2
  • 22
  • 33
  • good luck with this - different browsers offer different outcomes – Chris McClellan Mar 31 '11 at 20:50
  • 2
    Just FYI, many clients can open PDFs without having the "Adobe Reader" plugin specifically installed. Chrome and Safari even open them without external handler. – mario Mar 31 '11 at 20:54

4 Answers4

4

Give this a go: http://thecodeabode.blogspot.com/2011/01/detect-adobe-reader-plugin.html

Dean Barnes
  • 2,252
  • 4
  • 29
  • 53
2

You might be able to detect it through navigator.plugins.

HChen
  • 2,141
  • 13
  • 12
2

This has worked for me.

function isAcrobatReaderInstalled() {
                    var isInstalled = false;
                    if (window.ActiveXObject) {
                        var control = null;
                        try {
                            // AcroPDF.PDF is used by version 7 and later
                            control = new ActiveXObject('AcroPDF.PDF');
                        } catch (e) { }
                        if (!control) {
                            try {
                                // PDF.PdfCtrl is used by version 6 and earlier
                                control = new ActiveXObject('PDF.PdfCtrl');
                            } catch (e) { }
                        }
                        if (control)
                            isInstalled = true;
                    } else {
                        // Check navigator.plugins for "Adobe Acrobat" or "Adobe PDF Plug-in"*
    for (var i = 0; i<navigator.plugins.length; i++) 
            {   
                  var n = navigator.plugins[i].name;                              
                    if (n.indexOf('Adobe Acrobat') > -1 || n.indexOf('Adobe PDF') > -1)
                    {
                            isInstalled = true; 
                            break;
                    }
            }
                    }   
                    return isInstalled;
                }
moribvndvs
  • 42,191
  • 11
  • 135
  • 149
0

Mac OS X doesn't require Adobe Reader at all and Safari displays them directly in the browser window.

Do not force Adobe Reader and do not force the file to download instead of just displaying it.

Homer
  • 147
  • 1
  • 3