Solved

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

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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Internet is a big network which is formed by connecting multiple small networks.It is a platform for all the users which are connected to it.Internet act as platform in different fields. Such as: Internet  as a collaboration platform. Internet  as…
Citrix XenApp, Internet Explorer 11 set to Enterprise Mode and using central hosted sites.xml file.
Shows how to create a shortcut to site-search Experts Exchange using Google in the Chrome browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch the Search Engine Menu: In chrome, via you…
How to create a custom search shortcut to site-search Experts Exchange using Google in the Firefox browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch your Bookmark Menu: Press 'Ctrl +…

708 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

14 Experts available now in Live!

Get 1:1 Help Now