简体   繁体   中英

How to display MS-Excel and PDF document in web browser?

In the project I'm currently working on need to display pdf or excel files to users in their web browser.

We are using java to build up server side and jquery as main js lib for front-end.

What should I do to make this possible?

Or say, what jar or js do I need to rely on (perferably a js lib, but, well.. I have no clue right now..)?

Thanks in advance. :)

It's simple buddy, follow these steps:

  1. Open http://www.scribd.com/
  2. Sign up
  3. Sign in
  4. Upload your excel or pdf file
  5. Get it's iframe code
  6. Place the iframe code in your webpage.
  7. Done

You can make use Jquery datatables tool, to enable export to PDF/ excel. I have used this in earlier project, works very well. It's best part is it is configurable.

http://www.datatables.net/

Here are some few clews :

For pdf you can use the built-in of your browser if any, or you could use pdf.js .

For Microsoft documents, you should use Apache POI on server side, and maybe convert it in an other format like csv or json to send it back to your js client

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM