且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何确定是否在用户的浏览器可以查看PDF文件

更新时间:2023-12-01 18:29:40

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

Neither, none, don't try.

RE 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.