如何确定是否在用户的浏览器可以查看PDF文件 [英] How to determine if the user's browser can view PDF files

查看:222
本文介绍了如何确定是否在用户的浏览器可以查看PDF文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是确定用户的浏览器是否可以查看PDF文件的最好方法?

What's the best way for determining whether the user's browser can view PDF files?

理想情况下,它不应该的问题上的浏览器或操作系统。

Ideally, it shouldn't matter on the browser or the operating system.

有没有在ASP.NET做的一个特定的方式,或者将答案只是JavaScript的?

Is there a specific way of doing it in ASP.NET, or would the answer be just JavaScript?

推荐答案

都不是,没有,不要尝试。

Neither, none, don't try.

RE <一个href=\"http://stackoverflow.com/questions/76179/how-to-determine-if-the-users-browser-can-view-pdf-files#76220\">dawnerd:插件检测是不正确的答案。我没有安装在我的浏览器(Firefox在Ubuntu)一个PDF插件,但我能够使用的操作系统的文档查看器(不使用Acrobat Reader)来查看PDF文件。

Re dawnerd: Plug-in detection is not the right answer. I do not have a PDF plugin installed in my browser (Firefox on Ubuntu), yet I am able to view PDF files using the operating system's document viewer (which is not Acrobat Reader).

今天,任何操作系统,可以运行网络浏览器可以查看PDF文件的开箱。

Today, any operating system that can run a web browser can view PDF files out of the box.

如果一个特定的系统没有一个PDF浏览器安装并配置为使用它的浏览器,则可能意味着要么它是一个手工制作安装Windows,一个很下调备用操作系统或东西真的复古的。

If a specific system does not have a PDF viewer installed and the browser configured to use it, that likely means that either it's a hand-made install of Windows, a very trimmed down alternate operating system, or something really retro.

这是合理的假设,在任何这些情况下,用户会知道什么是PDF文件,要么故意选择不能够查看他们或不知道如何安装所需的软件。

It is reasonable to assume that in any of those situation the user will know what a PDF file is and either deliberately choose not to be able to view them or know how to install the required software.

如果我欺骗我自己,我很想把它给我解释以何种方式我错了。

If I am deluding myself, I would love to have it explained to me in which way I am wrong.

这篇关于如何确定是否在用户的浏览器可以查看PDF文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆