How can i check with php or js, if client browser for adobe reader plugin is installed?
Asked
Active
Viewed 8,638 times
2
-
good luck with this - different browsers offer different outcomes – Chris McClellan Mar 31 '11 at 20:50
-
2Just 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 Answers
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