Thanks to Alan Wolf for the link to get me started on detection of Acrobat reader from a webpage.
I modified some js code to work with Witango (ver 2000). The script will produce a variable @@local$acrobatversion
with the major version number. I needed this for a project so had to do it.
Enjoy.
Brian Mowers
______________________________________________
> TO UNSUBSCRIBE: Go to
> http://www.witango.com/developer/maillist.taf
>
>
________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
[EMAIL PROTECTED]
<Script> // Adobe Acrobat Detection v1.0 // documentation: http://www.dithered.com/javascript/acrobat_detect/index.html // license: http://creativecommons.org/licenses/by/1.0/ // code by Chris Nott (chris[at]dithered[dot]com) // modified by Brian Mowers 6-15-2005 To work with Witango Ver 2000 returns a local variable acrobatversion with the version Number
var acrobatVersion = 1;
function getAcrobatVersion() {
var agent = navigator.userAgent.toLowerCase();
// NS3+, Opera3+, IE5+ Mac, Safari (support plugin array): check for
Acrobat plugin in plugin array
if (navigator.plugins != null && navigator.plugins.length > 0) {
for (i=0; i < navigator.plugins.length; i++ ) {
var plugin = navigator.plugins[i];
if (plugin.name.indexOf("Adobe Acrobat") > -1) {
acrobatVersion = parseFloat(plugin.description.substring(30));
}
}
}
// IE4+ Win32: attempt to create an ActiveX object using VBScript
else if (agent.indexOf("msie") != -1 && parseInt(navigator.appVersion) >= 4
&& agent.indexOf("win")!=-1 && agent.indexOf("16bit")==-1) {
document.write('<scr' + 'ipt language="VBScript"\> \n');
document.write('on error resume next \n');
document.write('dim obAcrobat \n');
document.write('set obAcrobat = CreateObject("PDF.PdfCtrl.5") \n');
document.write('if IsObject(obAcrobat) then \n');
document.write('acrobatVersion = 5 \n');
document.write('else set obAcrobat = CreateObject("PDF.PdfCtrl.1") end if
\n');
document.write('if acrobatVersion < 5 and IsObject(obAcrobat) then \n');
document.write('acrobatVersion = 4 \n');
document.write('end if');
document.write('</scr' + 'ipt\> \n');
}
// Can't detect in all other cases
else {
acrobatVersion = acrobatVersion_DONTKNOW;
}
alert('Your Current Acrobat Version is :'+acrobatVersion)
if (acrobatVersion ==4) {
<@ASSIGN local$acrobatversion Value='4'>
} else if (acrobatVersion ==5){
<@ASSIGN local$acrobatversion Value='5'>
} else if (acrobatVersion ==6){
<@ASSIGN local$acrobatversion Value='6'>
} else if (acrobatVersion ==7){
<@ASSIGN local$acrobatversion Value='7'>
} else if (acrobatVersion > 8){
<@ASSIGN local$acrobatversion Value='8'>
}
return acrobatVersion;
}
acrobatVersion_DONTKNOW = -1;
</Script>
________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
