简体   繁体   English

如何在网络浏览器中显示MS-Excel和PDF文档?

[英]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. 在该项目中,我目前正在研究需要在其Web浏览器中向用户显示pdf或excel文件。

We are using java to build up server side and jquery as main js lib for front-end. 我们正在使用Java构建服务器端,并使用jquery作为前端的主要js库。

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..)? 或者说,我需要依靠什么jar或js(最好是js lib,但是,..我现在没有头绪了..)?

Thanks in advance. 提前致谢。 :) :)

It's simple buddy, follow these steps: 这是简单的伙伴,请按照以下步骤操作:

  1. Open http://www.scribd.com/ 打开http://www.scribd.com/
  2. Sign up 注册
  3. Sign in 登入
  4. Upload your excel or pdf file 上传您的Excel或pdf文件
  5. Get it's iframe code 获取它的iframe代码
  6. Place the iframe code in your webpage. 将iframe代码放在您的网页中。
  7. Done 完成

You can make use Jquery datatables tool, to enable export to PDF/ excel. 您可以使用Jquery数据表工具来启用导出到PDF / excel。 I have used this in earlier project, works very well. 我在较早的项目中已经使用过,效果很好。 It's best part is it is configurable. 最好的部分是它是可配置的。

http://www.datatables.net/ 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 . 对于pdf,您可以使用浏览器的内置功能(如果有),也可以使用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 对于Microsoft文档,您应该在服务器端使用Apache POI ,并可能将其转换为csv或json等其他格式,以将其发送回js客户端

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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