Google Docs 和 Zoho Writer 等网站使用什么来生成 MS Office 文档
我意识到这可能只是猜测,但我希望任何对此有见解的人发表评论。 类似于 MS Word COM 加载项、OO 桥或自定义实现。
我想知道的原因是我想为 php web 应用程序提供基本的在线文档编辑(非常基本,基本上只是富文本)。 我想我会以 html 格式存储标记,然后转换为 rtf/doc 等以方便用户。
I realise this may just be speculation, but I'd appreciate comments from anyone who has some insight into this.
Something like MS Word COM add-in, or an OO bridge, or a custom implementation.
The reason I want to know is that I want to provide basic online document editing (really basic, basically just rich text at this point) for a php web app. I'm guess I will store the markup in html format then convert to rtf/doc etc for user convenience.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
Apache POI 项目(用 Java 编写)为 MS Office 套件中的许多文件类型提供了接口。
您可以使用 PHP/Java 桥从 PHP 中运行 Java 代码。
我曾经在一个必须在 Web 应用程序中对 MS Word 文档建立索引的应用程序中使用过它。 我记得设置一切都很麻烦,但后来效果很好而且相当快。 (不幸的是,该代码是用 PHP4 编写的,我不拥有它,所以我无法在这里帮助您提供任何片段。)
PS 由于我是新用户,所以我无法发布链接,因此请在 google 上搜索“Apache POI”并“PHP/Java 桥”可访问相应项目的主页。
The Apache POI project (written in Java) offers an interface to many file types from the MS Office suite.
You can run the Java code from within PHP using the PHP/Java bridge.
I used this once for an application where MS Word documents had to be indexed in a web application. I remember that setting everything up was quite a hassle, but then it worked very well and reasonably fast. (Unfortunately, the code was written in PHP4 and I don't own it, so I cannot help you out with any snippets here.)
P.S. I cannot post links since I'm a new user, so google for "Apache POI" and "PHP/Java bridge" to get to the respective project's homepage.
此类可能对您有帮助。 我从未使用过它,但这里有一些链接:
This class might help you. I've never used it but here are some links:
他们可能已经编写了自己的代码,可能从 wvWare 或类似的东西开始。 我注意到 Linux 上的 Google Desktop 似乎使用 wvWare 来解析 MS Word 文档。
Word 文件格式的文档是可用的,但通读它会让您意识到这不是一件容易的事。
自动化 Word 或 OpenOffice 将是最简单的,但使用此类 Word 可能会存在许可问题,并且在 Web 服务器上使用其中任何一个都可能存在并发问题。
They have probably written their own, maybe starting from wvWare or something similar. I have noticed that Google Desktop on Linux seems to use wvWare to parse MS Word documents.
The documentation for the Word file formats is available, but reading through it makes you realize that it would not be an easy task.
Automating Word or OpenOffice would be the easiest, but there might be licensing issues with using Word like that, and possible concurrency issues with using either of them on a web server.
一种流行的方法是生成文件扩展名为 .doc 的 RTF。 它与 Word 和其他编辑器配合得很好,并且用户仍然很高兴它是“DOC 文件”
A popular way to do it is to generate RTF with the file extension .doc. It works fine with Word and other editors, and users remain happy that it is "a DOC file"