Solved

Javascript to force IE/Firefox/Chrome/safari to open Pdf in Adobe Reader

Posted on 2014-01-14
5
4,858 Views
Last Modified: 2014-01-15
Hi,

I have several Pdf (XML structured (XFA)) documents, which can only viewed using Adobe Reader - i.e. chrome/IE/Safari/Firefox's own readers cannot view these documents.

I require some code that can check if a users browser has the ability to view a document using Adobe reader, then prompts the viewer to accept defaulting the browser reader to that of Adobe reader and then opening the document accordingly, (if no adobe is installed on the users pc, present to offer the ability to download the free Adobe reader by providing a link if the reader itself and then make the browser add on the default reader for the applicable browser?

Many thanks
0
Comment
Question by:andrewpiconnect
  • 2
  • 2
5 Comments
 
LVL 30

Accepted Solution

by:
Alexandre Simões earned 250 total points
ID: 39778916
I would say you can't...

Browsers don't have access to whatever the pc have installed unless you use something like an ActiveX that still needs to be installed and given permissions to behave like so.
This isn't an option.

Downloading an XFA and open it automatically will require the user to choose Open instead of Save when he clicks the link.
If he does so, then it will open automatically on Adobe Acrobat Reader as I suppose it registers that extension automatically upon installation.

To overcome the problem when the user doesn't have Adobe AR installed you can redirect the user to a download page where the file download request is actually done.
On this page you'll show the instructions and links the user might need in case of trouble.

Note that this page won't require the user to click "Download" again.
This will be a generic page for all the files and on the querystring you should pass the file url and the download process should start automatically.

Cheers mate!
0
 
LVL 6

Assisted Solution

by:Mahesh Bhutkar
Mahesh Bhutkar earned 250 total points
ID: 39778931
0
 

Author Comment

by:andrewpiconnect
ID: 39781733
thanks for your replies.

However, html5 is not really what i am looking for as tbh i am not well versed on this, and having previously investigated it seemed very glitchy and unable to handle dynamic xfa forms,, could simply be how i set up though.

I'm sure i read somewhere that it was possible to check for the plug in programatically using JS and if not loaded/set as default reader to then recomend setting abobe reader as default in the browser giving "how to" instructions. Are you saying this is not possible?

Many thanks
0
 
LVL 30

Expert Comment

by:Alexandre Simões
ID: 39781919
Without specific ActiveX components that need user authorization to run, a webpage only knows about it's own sandbox.
You can't verify if the browser have some plugins installed or the PC have some software installed.

The other way around it works. for instance if you have a plugin installed it can intercept an action and behave as desired but that's the normal plug-in behavior as we all know.
0
 

Author Comment

by:andrewpiconnect
ID: 39781944
Many thanks.......i will have to re-plan my strategy for this then
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

I recently found myself in a Corporate Situation where the client had requested blocking access to any and all websites except his own Domain? Easy? I am sure this would be your answer but their requirement was, this has to be done without using…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
Google currently has a new report that is in beta and coming soon to Webmaster Tool accounts. This Micro Tutorial will highlight new features for Google Webmaster Tools.
This Micro Tutorial will demonstrate how nuggets on the Web are formatted by using Chrome Developer Tools. These tools would not only view the site's CSS but it can also modify it and save the CSS to use on your own site.

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

18 Experts available now in Live!

Get 1:1 Help Now