How to determine if the user's browser can view PDF files

前端 未结 4 993
后悔当初
后悔当初 2021-01-17 23:44

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.

I

4条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-17 23:56

    Neither, none, don't try.

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

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

    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.

    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.

提交回复
热议问题