English 中文(简体)
Is there any jquery plugin/script to detect Adobe Reader on user system?
原标题:

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

最佳回答

Googling turns up this:

jQuery browser plugin detection

问题回答

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.

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.

I m not sure, but is the pdf not automaticly downloaded when Adobe or a similar plugin is not available?

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.

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

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





相关问题
How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Extract everything from PDF [closed]

Looking for solution to extract content from a PDF file (using console tool or a library). It will be used on server to produce on-line e-books from uploaded PDF files. Need to extract following ...

PDF compression How does Adobe do it?

This is a bit more of a fun question than a serious one, but how does the Adobe PDF format make documents so... portable? I just created a small Word document, 235kb in size, containing multiple ...

Exporting HTML Tables

How can I export an HTML table in my page as PDF and/or XLS? (preferably using JS (+jquery))

Using Java PDFBox library to write Russian PDF

I am using a Java library called PDFBox trying to write text to a PDF. It works perfect for English text, but when i tried to write Russian text inside the PDF the letters appeared so strange. It ...

HTML --> PDF with PHP [duplicate]

Possible Duplicate: Convert HTML + CSS to PDF with PHP? How can I convert an HTML page (via $cURL or something) to a PDF file?

Free way to convert PDF to XPS with C#

Are there any free tools that I can use to convert a PDF document into an XPS document? Although a nice programmatic API would be nice, I m not opposed to shelling out to a command line tool to do ...

PDF conversion service

I need to develop a service able to convert MS Office and Open Office documents to PDF. And the PDF`s also need to be commentable when opened in ADOBE Reader. I have used a piece of software from www....

热门标签