Solved

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

Posted on 2014-01-14
5
4,977 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
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.

821 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