Reputation: 1700
How can i check with php or js, if client browser for adobe reader plugin is installed?
Upvotes: 2
Views: 8681
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
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
Reputation: 2272
Give this a go: http://thecodeabode.blogspot.com/2011/01/detect-adobe-reader-plugin.html
Upvotes: 4