CitznFish
12-04-2002, 09:14 PM
I have been searching high and low looking for a cross browser, cross platform Adobe Acrobat detect. Netscrape doesn't seem to be difficult, but IE doesn't seem to want to give up the info. Currently this is what I have, but I haven't been able to test it for No Plug-in on a MAC...
<SCRIPT LANGUAGE="Javascript" TYPE="text/javascript">
<!--Begin Hide
//Set the global variable
var hasAA=false;
//End Hide-->
</SCRIPT>
<SCRIPT LANGUAGE="VBScript" TYPE="text/vbscript">
<!-- //Begin Hide
on error resume next
set AAControl=CreateObject("PDF.PdfCtrl.1")
if (IsObject(AAControl)) then
hasAA=true
End if
// End Hide-->
</SCRIPT>
<SCRIPT LANGUAGE="Javascript" TYPE="text/javascript">
<!--Begin Hide
if (navigator.mimeTypes['application/pdf'])
{
hasAA=true;
}
//End Hide-->
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
<!--Begin Hide
if (hasAA=true)
{
document.write(" ");
}
else
{
document.write("<CENTER><font color=red><B>Warning: In order to view
these PDF files you need to
download the free <A HREF='http://www.adobe.com/products/acrobat/readstep.html'>
Adobe Acrobat Plug-In</A></B></font></CENTER>");
}
//End Hide-->
</SCRIPT>
I think writing a warning at the top for users without a plugin is
more acceptable than an alert box... I think there has got to be a
better method than what I posted above.. any ideas?? Thanks!
<SCRIPT LANGUAGE="Javascript" TYPE="text/javascript">
<!--Begin Hide
//Set the global variable
var hasAA=false;
//End Hide-->
</SCRIPT>
<SCRIPT LANGUAGE="VBScript" TYPE="text/vbscript">
<!-- //Begin Hide
on error resume next
set AAControl=CreateObject("PDF.PdfCtrl.1")
if (IsObject(AAControl)) then
hasAA=true
End if
// End Hide-->
</SCRIPT>
<SCRIPT LANGUAGE="Javascript" TYPE="text/javascript">
<!--Begin Hide
if (navigator.mimeTypes['application/pdf'])
{
hasAA=true;
}
//End Hide-->
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
<!--Begin Hide
if (hasAA=true)
{
document.write(" ");
}
else
{
document.write("<CENTER><font color=red><B>Warning: In order to view
these PDF files you need to
download the free <A HREF='http://www.adobe.com/products/acrobat/readstep.html'>
Adobe Acrobat Plug-In</A></B></font></CENTER>");
}
//End Hide-->
</SCRIPT>
I think writing a warning at the top for users without a plugin is
more acceptable than an alert box... I think there has got to be a
better method than what I posted above.. any ideas?? Thanks!