Solved

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

Posted on 2014-01-14
5
5,201 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
[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
  • 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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
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…
This Micro Tutorial will demonstrate how to add subdomains to your content reports. This can be very importing in having a site with multiple subdomains.
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.
Suggested Courses

630 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