JSFiddle - React, Tailwind, and code Playground
HTML
<p id="version"></p>
JavaScript
function CheckAdobeVersion() {
var isInstalled = false;
var version = null;
if (window.ActiveXObject) {
var control = null;
try {
// AcroPDF.PDF is used by version 7 and later
control = new ActiveXObject('AcroPDF.PDF');
} catch (e) {
// Do nothing
}
if (!control) {
try {
// PDF.PdfCtrl is used by version 6 and earlier
control = new ActiveXObject('PDF.PdfCtrl');
} catch (e) {
return;
}
}
if (control) {
isInstalled = true;
version = control.GetVersions().split(',');
version = version[0].split('=');
version = parseFloat(version[1]);
return version;
}
} else {
var plugins = navigator.plugins;
for(var i = 0; i < plugins.length; i++){
if (plugins[i].name === "Adobe Acrobat"){
version = plugins[i].version;
if(!version) {
version = plugins[i].description.split('"')[1];
}
return parseFloat(version);
}
}
}
}
$('#version').text(CheckAdobeVersion());