Solved

Acrobat detection

Posted on 2001-06-14
8
512 Views
Last Modified: 2013-11-18
This seems so easy but I can't figure it out!

I am looking for a script that will detect if a user has the Adobe Acrobat Reader plugin installed.  If they do not have it, i need the script to display a message and a link for them to get it.  Any help would be great.  
0
Comment
Question by:lazerproguy
8 Comments
 
LVL 15

Expert Comment

by:a.marsh
ID: 6192895
You can use this code:

if (navigator.plugins["LiveAudio"]){
  document.write("You have the LiveAudio plugin");
}
else{
  document.write("You do not have the LiveAudio plugin");
}


Only thing is I can't remember what the string is for Acrobat!

I'll see if I can find out.

Ant
0
 
LVL 15

Expert Comment

by:a.marsh
ID: 6192936
Here you go!

<html>
<head>
<script language="javascript">
<!--

if (navigator.plugins["Adobe Acrobat"]){
 document.write("You have the Adobe Acrobat plugin");
}
else{
 document.write("You do not have the Adobe Acrobat plugin");
}

//-->
</script>
</head>
<body>
</body>
</html>

:o)

Ant
0
 
LVL 15

Expert Comment

by:liebrand
ID: 6193071
Unfortunately, that only works on Netscape


0
 
LVL 15

Accepted Solution

by:
a.marsh earned 75 total points
ID: 6193103
You're right - the best cross browser I can get so far is:

<html>
<head>
<SCRIPT LANGUAGE="VBScript">
<!--
   on error resume next
   useAcrobat = not IsNull(CreateObject("AcroExch.Document"))

//-->      
</SCRIPT>
<script language="javascript">
<!--

if (navigator.plugins["Adobe Acrobat"] || useAcrobat){
document.write("You have the Adobe Acrobat plugin");
}
else{
document.write("You do not have the Adobe Acrobat plugin");
}

//-->
</script>
</head>
<body>
</body>
</html>


But you might get a security warning in IE.

Ant
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 3

Expert Comment

by:yas022100
ID: 6193209
I got this snippet...

<script language=javascript>
var isInstalled = isControlInstalled("Adobe Acrobat", "AcroExch.Document")

if (isInstalled == 0) alert("never know")
else if (isInstalled == 1) alert("yup, installed")
else alert("nope")

function isControlInstalled(strName, strProgID) {
   var isInstalled
   if (document.layers) {
       // NN
       return isPlugin(strName)
   }
   else if (document.all) {
       // IE
       return isActiveXObject(strProgID)
   }
   else {
       // other browser
       return 0
   }
}

// doesn't work with IE
function isPlugin(strPluginName) {
   for (i = 0; i < navigator.plugins.length; i++) {
       if (navigator.plugins[i].name == strPluginName) return 1
   }
   return 2
}

// return values: 0=unknown, 1=true, 2=false
function isActiveXObject(strProgID) {
   try {
       // should be installed at any rate
       obj = new ActiveXObject("InternetExplorer.Application")
       obj = null
   }
   catch(e) {
       // but ActiveX and or Scripting is disabled
       // that doesn't mean that strProgID isn't installed...
       return 0
   }
   try {
       obj = new ActiveXObject(strProgID)
       obj = null
       // strProgID is installed
       return 1
   }
   catch(e) {
       // strProgID is not installed
       return 2
   }
}
</script>
0
 

Author Comment

by:lazerproguy
ID: 6202236
Thanks a lot, I think I'll be able to work with this.
0
 

Author Comment

by:lazerproguy
ID: 6202311
Thanks a lot, I think I'll be able to work with this.
0
 

Author Comment

by:lazerproguy
ID: 6202312
Thanks a lot, I think I'll be able to work with this.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
jQuery Parallax 1 38
jQuery Syntax 2 47
validation, if text area is typed or pasted into 2 25
How to generate a JSON response in coldfusion 4 22
In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
I made this because I wanted to get e-mail with a attached csv file so I'd would be able to import user input into a MS Excel template, but I also wanted to register/save all inputs from each day in a file on the server. 1st - It creates a temp C…
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now