开发者

Is there a way to force PDFs to open in Adobe Reader rather than in plugins?

We have an Air and Flash application that opens a pdf, but many computers by default open pdfs in browser plugins rather than throu开发者_如何学运维gh reader itself. Is there a way to force the alternate behavior in Flash/Air?

This is needed since we have slightly writable pdfs.

Thanks!


I assume people are downloading your pdf's of a folder and You provide a link to that file. If that is the game, you can add in that same folder a htaccess-file which prevents pdf file to open in browser.

You should do this:

  1. Create new a txt-file with any text editor
  2. Copy paste this in it: Header set Content-Disposition "attachment"
  3. Save it as: htaccess.txt
  4. Drop it in your download folder in your server
  5. Rename it: .htaccess

Thats all.

BUT The easy way is to zip the pdf.


I up-voted your question because I have a very similar issue (only I want to open Acrobat Reader full, instead of the plug-in, from a normal webpage and not an Air app). However, after researching (Googling) it a ton, I've become convinced that there is no way (for either of us).

The problem is that the browser essentially just does a simple MIME-type lookup to determine "I should open this in the Reader plug-in". As a result, there doesn't seem to be anything a given web page/air app can do to make the browser use a different app; the only way to change things is for the user to edit their browser preferences. The only thing that might work is if you changed the MIME type of the file being served ... but then that would just prompt the user to pick a program; it wouldn't automatically open in the standalone reader.

Anyhow, I'd love to see someone else post an answer proving me wrong, but after spending several hours on this I'm afraid we're both probably out of luck.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜