Solved

How to identify Acrobat reader on client browser

Posted on 2009-04-14
5
221 Views
Last Modified: 2013-10-08
Hi All,

Can some body provide me the code to check if Acrobat reader is installed on client's browser.
I have written a block of javascript code but it is not working properly...

Any help in this regards will be highly appreciated.
0
Comment
Question by:AshuSharma8
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 9

Expert Comment

by:Sreedhar Vengala
ID: 24136416
<html>
<script>
<!--
var p;
try {
p = new ActiveXObject('AcroExch.Document');
}
catch (e) {
// active x object could not be created
document.write('<a href="http://www.acrobat.com">acrobat</a>');
}
if (p) window.location='http://www.hotmail.com';
// -->
</script>
</html>

*** Fixed some quotes and commented out an end comment *** mplungjan, EE page editor

Open in new window

0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 24137178
0
 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 250 total points
ID: 24137325
And here is one I DID test - modified from http://www.oreillynet.com/cs/user/view/cs_msg/4055

<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>

Open in new window

0

Featured Post

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
powershell md/mkdir/New-item   -Quiet 10 376
Customising IE behaviour on certain pages 2 97
PowerShell and cisco ios 3 68
Ruby or Python 7 127
Using Quotation Marks in PHP This question (http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/Q_28217211.html) seems to come up a lot for developers who are new to PHP.  And it got me thinking, "How can we explain the rule…
These days, all we hear about hacktivists took down so and so websites and retrieved thousands of user’s data. One of the techniques to get unauthorized access to database is by performing SQL injection. This article is quite lengthy which gives bas…
Wufoo.com provides powerful tools for surveying targeted groups, and utilizing data from completed surveys to find trends, discover areas of demand or customer expectation, and make business decisions on products or services.
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…

739 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