Java MS Word 库

发布于 2024-08-09 22:03:21 字数 459 浏览 1 评论 0原文

我有文档,我想将所有模板参数(如 {name}、{address})更改为我自己的值。我尝试使用 POI HWPF Library,但保存后文档格式丢失。即使我使用 POI 打开 MS Word 文档并保存它(不进行任何更改),文档格式也会丢失:) 格式意味着居中、字体大小等(没有任何表格或图片 - 只是“纯文本”)。

对于这种情况我可以使用什么库?也许任何人都有使用 MS Word 文档和 java 的经验。 要求:开源,不使用任何 Windows COM 组件(多平台),不是 OOXML - Microsoft Word XP 2003。也

有类似的问题(关于保存后截断文档) Java:使用 POI/HWPF 解析 ms-word 文档

I've document and I want to change all template parameters like {name}, {address} to my own values. I tried to use POI HWPF Library, but I lost document formatting after saving. Even when I open my MS Word document with POI and save it (without any changes) document formatting is lost:) Formatting means centering, font size, etc (there are no any tables or pictures - just 'plain text').

What library I can use for this case? Maybe anyone have expirience with MS Word documents and java.
Requirements: Open Source, Without using any Windows COM components (muliplatform), Not OOXML - Microsoft Word XP 2003.

There are similar question (about truncating document after saving)
Java: parsing ms-word document using POI/HWPF

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

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

发布评论

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

评论(1

苹果你个爱泡泡 2024-08-16 22:03:21

我无法从自己的经验中得知,但是您尝试过 OOo Java API 吗?从我所听到和看到的情况来看,他们非常优秀且灵活。这不仅适用于 MS Word 文档。

尝试一下。

I can't tell from own experience, but have you tried the OOo Java API's? From what I've heard and seen is that they're very good and flexible. And that not only for MS Word documents.

Give it a try.

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