I am viewing PDF into iframe. It works fine. But some of the client don\'t able to see it in IE. They get it as download option.
How can I identify if browser has pdf v
PDF format is a licensed adobe format, from my understanding it's probably not always going to be reliable detection if you need to account for all non-licensed PDF readers also.
However, there is this resource: http://www.pinlady.net/PluginDetect/PDFReader/
The basic idea is:
"application/pdf"
in the browser's navigator.mimeTypes
arraynavigator.mimeTypes
array test fails, a second test is run in the background (i.e. nothing shown to the user on the frontend) which sends the browser a lightweight "empty" pdf file to see if it can be interpretedOf course the idea of running a test pdf in the background might be a costly solution (i.e. mobile users on 3G etc.) but it's probably going to be a pretty reliable method, and the good part is you only have to test your user once when they reach your domain and then set a cookie
or localStorage
item with their pdf config saved so you don't have to keep testing their pdf capability.