简体   繁体   English

在浏览器中查看Word文档和PDF?

[英]View word docs and PDF in browser?

I am currently working on a site that has to have the ability for users to view documents that are uploaded, however they need to be viewable in browser. 我目前在一个网站上工作,该网站必须让用户能够查看上传的文档,但是需要在浏览器中查看它们。

I know there is the Google docs viewer (however this does not seem to work when trying toopen it in a fancybox overlay), but are they any other alternatives, maybe some API's that could turn them into Flash or similar, and then I could simply embed it as a swf? 我知道有一个Google文档查看器(但是,当尝试在fancybox叠加层中打开它时似乎不起作用),但是它们还有其他替代方法吗,也许有一些API可以将它们变成Flash或类似的东西,然后我可以简单地嵌入为瑞士法郎吗?

Any help would be greatly appreciated. 任何帮助将不胜感激。

but are they any other alternatives, maybe some API's that could turn them into Flash or similar, and then I could simply embed it as a swf? 但是它们还有其他选择吗,也许有一些API可以将它们变成Flash或类似的东西,然后我可以将其作为swf嵌入?

Yes, there are APIs for converting word and PDF documents to Flash (swf). 是的,有用于将Word和PDF文档转换为Flash(swf)的API。 There is also a possibility to convert them to pure HTML so that the documents are shown directly in browser without Word or PDF software (Adobe Reader, etc.). 也可以将它们转换为纯HTML,以便直接在浏览器中显示文档,而无需Word或PDF软件(Adobe Reader等)。 Personally I use Print2Flash utility for putting my documents online. 我个人使用Print2Flash实用程序将文档置于在线状态。 It converts my documents to both Flash and HTML formats at the same time. 它将我的文档同时转换为Flash和HTML格式。 I do the conversion manually but there is an API for conversion as well as I can see here: http://print2flash.com/print2flashapi.php 我手动进行转换,但这里有一个API可以进行转换: http : //print2flash.com/print2flashapi.php

You said "however this does not seem to work when trying toopen it in a fancybox overlay" Did you tried with headers : 您说“但是,当尝试在fancybox覆盖中打开它时,这似乎不起作用”您是否尝试使用标头:

header("Content-type:application/pdf");
header("Content-type: application/vnd.ms-word");

For swf conversion see this 对于SWF转换看到这个

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

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