如何用Java编辑word文档

发布于 2024-08-26 11:30:14 字数 28 浏览 5 评论 0原文

如何使用 Java 编辑 Word 文档?

How can you edit a word document with Java?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

铜锣湾横着走 2024-09-02 11:30:14

您也可以使用 COM 来做到这一点。使用 Java COM 互操作库,如 JACOB (JAVA COM BRIDGE): http://sourceforge.net/projects /jacob-project/

这是使用 Jacob 与 MS Word 对话的教程:http://www.land-of-kain.de/docs/jacob/

另一个看起来很有前途并且能够解决跨平台问题的库是 J-Interop:http://www.j-interop.org/

You can use COM to do that also. Use a Java COM interop library like JACOB (JAVA COM BRIDGE): http://sourceforge.net/projects/jacob-project/

Here is a tutorial using Jacob to talk to MS Word: http://www.land-of-kain.de/docs/jacob/

The other library that looks promising and that will solve the cross-platform problem is J-Interop: http://www.j-interop.org/.

相守太难 2024-09-02 11:30:14

过去,我曾使用 OpenOffice.org 的 Java API 解决过此类问题。它并不完全是轻量级的,但许可条款很慷慨,并且它得到了开发社区的支持,该社区具有既得利益,确保它可以解析 Microsoft 对 Word 文件格式造成的任何奇怪现象。可能值得一看。

In the past, I've solved problems like this using OpenOffice.org's Java API. It's not exactly lightweight, but the licensing terms are generous and it has the backing of a development community with a vested interest in making sure it can parse whatever weirdness Microsoft inflicts on the Word file format. Might be worth a look.

怕倦 2024-09-02 11:30:14

我对任何标准都不熟悉。它还取决于Word的版本,因为不同版本使用不同的文件格式。

Apache 的 POI 项目 应该提供执行此操作的方法:

I'm not familiar with anything standard. It also depends on the version of Word, since various versions use different file formats.

The POI project from Apache is supposed to provide ways to do this:

我不会写诗 2024-09-02 11:30:14

您也可以尝试类似 SIKULI 的方法。

You could also try something like SIKULI.

节枝 2024-09-02 11:30:14

您可以尝试 Docmosis,它允许您从 Java 填充或生成 Word 文档。它基于 BlairHippo 使用 OpenOffice API 的建议,但无需学习 api。 JODReports 类似。

You could try Docmosis, which allows you to populate or produce word docs from Java. It's based on BlairHippo's suggestion of using the OpenOffice API but without needing to learn the api. JODReports is similar.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文