8/30/2010 10:03:59 PM
Title:
check abobe reader is installed in computer
Hi.
I want to check in my computer adobe reader software is installed or not in action script 3.0.
Example: Suppose adobe reader software is not installed in pc then massage show “adobe reader is not available”. If adobe reader software is already installed. Then massage show “adobe reader is already available
Tell the logic in oop s language (action script 3.0).
8/30/2010 10:33:15 PM
Flash does support detection of any other plugin than flash player. You can use the below JavaScript to detect the version of Acrobat plugin in html page . Also you can call this JavaScript from flash using externalInterface class and get back the result to show the message flash. Here is the script
<script type="text/javascript">
var acrobat=new Object();
acrobat.installed=false;
acrobat.version='0.0';
if (navigator.plugins && navigator.plugins.length){
for ( var x = 0, l = navigator.plugins.length; x < l; ++x ) {
if (navigator.plugins[x].description.indexOf('Adobe Acrobat') != -1 || navigator.plugins[x].description.indexOf('PDF') != -1) {
acrobat.version=(navigator.plugins[x].description.indexOf('PDF')!=-1)?'7+':parseFloat(navigator.plugins[x].description.split('Version ')[1]);
if (acrobat.version.toString().length == 1) acrobat.version+='.0';
acrobat.installed=true;
break;
}
}
}
else if (window.ActiveXObject) {
for (x=2; x<10; x++) {
try {
oAcro=eval("new ActiveXObject('PDF.PdfCtrl."+x+"');");
if (oAcro) {
acrobat.installed=true;
acrobat.version=x+'.0';
}
}
catch(e) {}
}
try {
oAcro4=new ActiveXObject('PDF.PdfCtrl.1');
if (oAcro4) {
acrobat.installed=true;
acrobat.version='4.0';
}
}
catch(e) {}
try {
oAcro7=new ActiveXObject('AcroPDF.PDF.1');
if (oAcro7) {
acrobat.installed=true;
acrobat.version='7+';
}
}
catch(e) {}
}
alert (acrobat.version);
</script>
8/31/2010 12:14:33 PM
Flash cant detect PDF plugin.
Dave good code , keep it up