function Ispdfplugininstall () {
if (!isie ()) {//ie browser and non-IE browser support
Not IE
if (navigator.plugins && navigator.plugins.length)///Adobe Reader | Adobe PDF | Acrobat | Chrome PDF Viewer
for (var i = 0; i < navigator.plugins.length; i++) {
var plugin = Navigator.plugins[i].name;
Console.log (plugin);
if (plugin = = ' adobe Reader ' | | plugin = = ' adobe pdf ' | | plugin = = ' Acrobat ' | | plugin = = ' Chrome PDF Viewer ') return True ;
}
return false;
} else {
Ie
var isInstalled = false;
var version = null;
var control = null;
try {
Control = new ActiveXObject (' acropdf.pdf ');
} catch (e) {
Alert (e);
}
if (!control) {
try {
Control = new ActiveXObject (' Pdf.pdfctrl ');
} catch (e) {
}
}
if (!control) {
try {
Control = new ActiveXObject (' Adobe Acrobat ');
} catch (e) {
}
}
if (!control) {
try {
Control = new ActiveXObject (' Adobe PDF plug-in ');
} catch (e) {
}
}
if (control) {
IsInstalled = true;
Version = control. Getversions (). Split (', ');
Version = Version[0].split (' = ');
Version = Parsefloat (version[1]);
return isInstalled;
}
}
}
function Isie () {//ie support to Ie11
if (!! Window. ActiveXObject | | "ActiveXObject" in window)
return true;
Else
return false;
}
JS to determine if the PDF player is installed