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

<p>Ideally, it shouldn't matter on the browser or the operating system.</p>

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

[{'answer_id': 76220, 'author': 'dawnerd', 'author_id': 69503, 'author_profile': 'https://Stackoverflow.com/users/69503', 'pm_score': 2, 'selected': False, 'text': '<p>A quick google search <a href="http://www.oreillynet.com//cs/user/view/cs_msg/9920" rel="nofollow noreferrer">found this</a>. Useful for all kinds of plugins.</p>\n'}, {'answer_id': 76253, 'author': 'ddaa', 'author_id': 11549, 'author_profile': 'https://Stackoverflow.com/users/11549', 'pm_score': 5, 'selected': True, 'text': '<p>Neither, none, don\'t try.</p>\n\n<p>Re <a href="https://stackoverflow.com/questions/76179/how-to-determine-if-the-users-browser-can-view-pdf-files#76220">dawnerd</a>: 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).</p>\n\n<p>Today, any operating system that can run a web browser can view PDF files out of the box.</p>\n\n<p>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.</p>\n\n<p>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.</p>\n\n<p>If I am deluding myself, I would love to have it explained to me in which way I am wrong.</p>\n'}, {'answer_id': 76319, 'author': 'Antony', 'author_id': 12361, 'author_profile': 'https://Stackoverflow.com/users/12361', 'pm_score': 2, 'selected': False, 'text': '<p>There are users that choose not to open PDF\'s in the browser and disable the plugin (this allows the file to be opened in the native application external of the browser window). It is better to let the user know that software is required to open something (whether it be PDF or not) than try to detect whether the plugin is available.</p>\n\n<p>Another problem with detection is that what you need to look for changes from version to version (for example, see: "PDF.PdfCtrl.*" vs "AcroPDF.PDF.*" for the Adobe PDF viewer) and different browser implementations (the previously mentioned strings are used in IE for example, while Firefox uses a totally different manner of detection. Then we need to think of Opera and Safari and ???). Also, there are different vendors (think Foxit and Ghostscript, though I am not sure if they supply a plugin for the browser) where there may be differences in detecting the plugin.</p>\n\n<p><p>For a script written in 2008 and some more information about the caveats see <a href="http://www.builtfromsource.com/2007/06/26/detecting-plugins-in-internet-explorer-and-a-few-hints-for-all-the-others/" rel="nofollow noreferrer">Detecting plugins in Internet Explorer (and a few hints for all the others)</a>.</p>\n'}, {'answer_id': 87881, 'author': 'Joe Ratzer', 'author_id': 4092, 'author_profile': 'https://Stackoverflow.com/users/4092', 'pm_score': 2, 'selected': False, 'text': "<p>After initially ignoring the advise on this page the architect went ahead with Acrobat detection, causing an inevitable support nightmare.</p>\n\n<p>As ddaa mentions not all the scenarios can be accurately captured with Plug-in detection. Some users, for example, may choose to view PDF files with FoxIt Reader rather than acrobat. Some user's browsers don't flag that they are Acrobat ready, and certainly not always in the same way.</p>\n\n<p>A better solution would have been to give the user a choice on how they'd like to view the relevant document. Personally, I don't like to have any website rely on a plug-in - it spoils the beauty of the web.</p>\n"}]
['https://Stackoverflow.com/questions/76179', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4092/']