Solved

Determine if a user has Acrobat installed

Posted on 2004-08-25
7
342 Views
Last Modified: 2013-11-18
Is there a way to determine if a user has Acrobat ( or some other PDF reader ) installed, without using ActiveX?
0
Comment
Question by:justinbillig
[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
  • 3
  • 3
7 Comments
 
LVL 33

Expert Comment

by:snoyes_jw
ID: 11895921
Yes.  Ask the user.  "Click <here> if you have Acrobat installed, otherwise click <here>."
As far as a way to do it with JavaScript, not likely.
0
 
LVL 19

Expert Comment

by:RanjeetRain
ID: 11896793
Of course possible. Even with JavaScript. But not worth the effort for 50 points. ha ha ha
0
 
LVL 15

Author Comment

by:justinbillig
ID: 11897055
well could you point me into the right direciton so i can figure it out?
0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
LVL 19

Accepted Solution

by:
RanjeetRain earned 50 total points
ID: 11897293
Iterate thru available plug-ins. If the browser is handling .pdf type, you know that there is a RDF reader installed.
0
 
LVL 15

Author Comment

by:justinbillig
ID: 11901532
i tried that ... i looped through the navigator.plugins and navigator.mimeTypes .... but it kept giving me nothing, it said i had no plugins

i found this example http://www.quirksmode.org/js/flash.html
0
 
LVL 15

Author Comment

by:justinbillig
ID: 11901872
<HTML>
      <head>
            <script language="javascript">
                  // ----------------------------------------------------------
                  // Name: DetectAcrobat( )
                  // Abstract: Detect if acrobat is installed on the client
                  // ----------------------------------------------------------
                  function DetectAcrobat( )
                  {
                        try
                        {
                              var blnInstalled = false; // Assume No
                        
                              // What broswer version are we using?
                              if( document.all )
                              {
                                    // Check IE
                                    blnInstalled = CheckInternetExplorer( );
                              }
                              else
                              {
                                    // Check netscape
                                    blnInstalled = CheckNetscape( );
                              }
                              
                              // Alert for testing
                              alert( blnInstalled );
                        }
                        catch( expError )
                        {
                              alert( "DetectAcrobat( )::" + expError.description );
                        }
                  }
                              

                  // ----------------------------------------------------------
                  // Name: CheckNetscape( )
                  // Abstract: Check netscape for acrobat
                  // ----------------------------------------------------------      
                  function CheckNetscape( )
                  {
                        try
                        {
                              // Variables
                              var blnInstalled = false; // Assume No
                              var objAcrobat = null;
                  
                              // Get a reference to acrobat
                              objAcrobat = navigator.mimeTypes[ 'application/pdf' ];
                              
                              // Is this acrobat?
                              if( objAcrobat != null )
                              {
                                    // Yes
                                    blnInstalled = true;
                              }

                              // Return value            
                              return blnInstalled;
                        }
                        catch( expError )
                        {
                              alert( "CheckNetscape( )::" + expError.description )
                        }
                  }
            </script>
            <script language="vbscript">

                  ' -------------------------------------------------------------
                  ' Name: CheckInternetExplorer( )
                  ' Abstract: Check internet explorer for acrobat
                  ' Note: This code is supposed to cause errors because were
                  ' checking for the all the versions ( and more ) of acrobat
                  ' but if you try to create an object that doesn't exist
                  ' you will gte an error. Hence the on error resume next.
                  ' -------------------------------------------------------------

                  function CheckInternetExplorer( )
                        on error resume next
                              
                        ' Variables
                        dim blnInstalled
                        dim intIndex
                                    
                        ' Initialize
                        blnInstalled = false ' Assume No
                        intIndex = 0
                        
                        ' Can we create a pdf object?
                        for intIndex = 0 to 20 step 1
                                    
                              ' Try and create an object
                              If Not IsObject( CreateObject( "Pdf.PdfCtrl." & intIndex ) ) Then
                                    ' Do nothing
                              else
                                    ' It's installed!!!
                                    blnInstalled = true
                              End If
                        next
                              
                        ' Return Results
                        CheckInternetExplorer = blnInstalled
                  end function

            </script>
      </HEAD>
      <BODY>

            <button onclick="DetectAcrobat( );" > Determine if Acrobat Is Installed</button>

      </BODY>
</HTML>



Ok i wrote this ... based on the code from the quirksmode.org .. i tested it in IE 5.5 and NS 7.1 ... could other people give it a run and tell me if it works, specifically someone who doesnt have a pdf reader installed
0
 
LVL 19

Expert Comment

by:RanjeetRain
ID: 11912253
Good good. Now pls award me the points.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
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…
Suggested Courses

626 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