使嵌入在网页中的Word文档可编辑或只读 [英] Making Word document embedded in a web page editable or read-only

查看:328
本文介绍了使嵌入在网页中的Word文档可编辑或只读的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用iframe这样将一些Word文档嵌入到我们的网页中:

I'm embedding some Word documents into our web page using iframe like this:

<iframe src="ftp://ftp.example.com/www/uploads/Image/test.doc" width="100%" height="400">  
    Alternative
</iframe>

问题是嵌入式Word控件允许用户编辑文档并显示一个图标来保存它们,但实际上不保存任何内容.是否可以设置Word将编辑内容保存回FTP服务器?如果不是,是否有某种方式我们可以将文档设为只读,以便用户不知道他们可以进行更改?我们正在使用IE7和Word 2003.

The problem is that the embedded Word control allows the user to edit the documents and shows an icon to save them, but doesn't actually save anything. Is it possible to setup Word to save edits back to the FTP server? If not, is there someway we can make the document read-only so the user doesn't get the idea that they can make changes? We're using IE7 and Word 2003.

(我刚刚问了一个有关将Word保存到FTP服务器的相关问题:

(I just asked a related question about getting Word to save to a FTP server: Possible for Word to edit documents directly off an web server without Sharepoint?)

推荐答案

有许多解决您的问题的方法,我认为最简单的是商业应用程序: http://html5boilerplate.com/

There are a number of solutions to your problem, the easiest in my oppinion is a commercial app: https://crocodoc.com/. Developers have unlimited preview time but production use requires a license, don't know if thats an option in your case? To get this working in IE7 you will also need http://html5boilerplate.com/ together with http://code.google.com/p/html5shiv/.

不确定此解决方案是否仍然免费,但目前是否可用: https://cloudconvert.org/page /api .它们提供了一个将文档转换为html的api,您可以编写脚本以在上传时将文档转换为html,然后存储html以在网站上显示.

Not sure if this solution will remain free but it is at the moment: https://cloudconvert.org/page/api. They provide an api to convert documents to html, you could write a script to convert docs to html on upload and then store html to show on site.

另一个不错的选择是 http://www.phpdocx.com/他们有一个转换插件可以转换docx转换为HTML,pdf等.

Another good option is http://www.phpdocx.com/ they have a conversion plugin to convert docx to HTML, pdf and such.

至于使您现有的解决方案为只读,我在某处阅读了可以使用以下方法进行的操作,但是我无法像在Mac上那样进行测试,并且目前无法使用IE访问计算机.

As for making your existing solution read only, i read somewhere you can do it with the method below but i am unable to test as i am on a mac and currently have no access to a machine with IE right now.

<object id="msword" width="100%" height="100%" classid="clsid:67F2A879-82D5-4A6D-8CC5-FFB3C114B69D" data='[insert document name].doc'>
    <PARAM NAME="src" VALUE="file:////[insert full document path here].doc" >
    <PARAM NAME="readonly" value=true>
</object>

希望这些建议对您的项目有所帮助!

Hope these suggestions help you with your project!

这篇关于使嵌入在网页中的Word文档可编辑或只读的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆