问题
Is there any jquery plugin/script to detect Adobe Reader on user system ? and it is not then show a message to download.
Code should be compatible with all A-grade browsers.
alt text http://easycaptures.com/fs/uploaded/448/6837085829.png
回答1:
Googling turns up this:
jQuery browser plugin detection
回答2:
I found this Generic PDF Reader detector solution to be the most comprehensive.
- Covers all the A-list browsers (and many others)
- Handles cases with built-in pdf readers (e.g. Mac Safari, Chrome).
- It uses ActiveX to test IE (which doesn't support navigator.MimeTypes correctly)
- Well Documented (including scenarios which may not provide precise information)
- Can report plugin version
- Get a copy here
The same site also has other detectors for other types of plugins.
回答3:
Don't stress about which plugin they're using. Just check for support for the 'application/pdf' MIME type, and let the browser take care of the rest.
if ("application/pdf" in navigator.mimeTypes) { // ... do work }
The only reason I'd want to test for Adobe Reader is to detect outdated & broken versions, so I can prompt the user to upgrade. Old versions tend to complain that PDFs are broken when they're just a newer, unsupported PDF format or use features that viewer doesn't understand. Few users understand what's doing the PDF viewing and would never think to update Adobe Reader if they have problems, so it's a good idea to help them out.
If you don't detect Adobe Reader, just check for the MIME type and go ahead. That way you won't break FoxIt, Chrome's native PDF viewing, Safari's native PDF viewing, etc.
回答4:
I'm not sure, but is the pdf not automaticly downloaded when Adobe or a similar plugin is not available?
回答5:
I don't have adobe reader, but I do have Foxit reader, which will take care of Acrobat documents. Therefore it's not a good idea to try to detect what the user has installed. Instead let the users system deal with it. If they have Adobe Reader, then it will deal with PDF files, if not, it will download and open in an app that can deal with it. If you want to help a user, add a discreet link to download Adobe Reader next to the link to the file their downloading.
回答6:
Don't do this. Some users (like me) prefer to just download the PDF and not let it display in browser (through adobe readers browser plugin).
Then, there is no way to detect if the user has any program to display PDF files installed. Systems vary wildly (e.g. on Mac OS X you do not need Adobe Reader, there the "Viewer" application can display PDF files).
回答7:
To detect using Javascript if Adobe Reader plugin is installed in a browser, go to Detect Adobe Acrobat Plugin for full downloadable code. The script detects IF and which version of acrobat is installed, as well as the browser type
来源:https://stackoverflow.com/questions/1900257/is-there-any-jquery-plugin-script-to-detect-adobe-reader-on-user-system