Solved

How to identify Acrobat reader on client browser

Posted on 2009-04-14
5
225 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

WordPress Tutorial 4: Recommended Plugins

Now that you have WordPress installed, understand the interface, and know how to install new parts, let’s take a look at our recommended plugins.

Question has a verified solution.

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

Introduction A frequently used term in Object-Oriented design is "SOLID" which is a mnemonic acronym that covers five principles of OO design.  These principles do not stand alone; there is interplay among them.  And they are not laws, merely princ…
What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
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…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

615 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