Java MS Word 库
我有文档,我想将所有模板参数(如 {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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我无法从自己的经验中得知,但是您尝试过 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.