Faraona
Faraona

Reputation: 1700

How can i detect if client browser have adobe reader plugin installed

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

Upvotes: 2

Views: 8681

Answers (4)

Homer
Homer

Reputation: 147

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.

Upvotes: 0

moribvndvs
moribvndvs

Reputation: 42497

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;
                }

Upvotes: 2

HChen
HChen

Reputation: 2141

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

Upvotes: 2

Related Questions