用于 WordML 到 Word2002 转换的 Java 库

发布于 2024-09-09 22:15:19 字数 1271 浏览 1 评论 0原文

对于我正在从事的一个项目,我需要将 WordML 流转换为 Word 2002 兼容的 .doc 格式(不要问为什么 - 但相当多的用户仍在使用 Word 2002,升级到最新版本直到 2010 年第四季度才可行)。我尝试过研究很多选择,但大多都陷入了死胡同。

我的用例是,有一个现有的基于 Java 的 Web 服务(在 Tomcat 下的 Solaris 上运行),该服务根据用户的请求调用第三方服务。此 3rdParty 服务将返回 pdf 文档和 WordML 文档。然后,我们需要将 Word ML 文档转换为 Word 2002 格式,并且我们的 Web 服务更新页面以链接到 pdf 和 pdf。 Word 2002 文档,然后可以由 Web 服务的用户打开。

Aspose.Words for Java 是我最好的选择,但它也返回了 WordML 的 UnsupportedDocumentFormat 异常。首先我认为这可能是我的文档,但所有其他文档也都失败了,然后 Aspose 的后续显示尽管有文档,但当前版本不支持 Java 中的 WordML (http://www.aspose.com/community/forums/248442/wordml-support/showthread.aspx#248442)

我本来会采用编写 .Net 服务来进行转换的方法 - 但也有一些安静的问题 - (a) 我的服务 [现有] 在 Solaris Box 上运行 (b) MS 不建议使用单词自动化以这种方式,由于多线程性能较差(c)使用Aspose.Words for .Net - 但这意味着巨大的硬件成本+ .Net许可证等。

我探索了为WordML-> RTF转换找到这种可能性的可能性,但没有找到合适的图书馆也可以。除了 WordML 会包含一些我们尚不知道 RTF 是否支持的大量图表之外,我们也无法确定这些图表,因为目前在安装 Word 2002 时只有 WordML 可供我们使用。

所以,事情是这样的: 除了 Aspose.Words for Java 之外,是否有任何库可用于进行 WordML->Word2002 [或 rtf] 转换,该转换不依赖于 Windows 主机执行任何操作(更不用说实际的 MS Word 安装)。

很抱歉问了很长的问题,但我真的想不出任何选择。任何指向合适库的帮助/建议/指针都将非常有用。付费图书馆可能没问题,只要我们可以选择提前尝试一下,以便向项目赞助商说明情况。

For a project I am working on, I need to convert WordML stream into Word 2002 compatible .doc format (don't ask why - but quite a large group of users are still on Word 2002 with upgrade to latest version not feasible till Q4 2010). I have tried to research a lot of options and have mostly hit a dead end.

My use case is that there is a existing Java-based web service (running on Solaris under Tomcat) which on user's request makes a call to third-party service. This 3rdParty service will return a pdf document and a WordML document. We then need to convert Word ML document to Word 2002 format and our web service updates the page to link to both pdf & word 2002 document which can then be opened by users of web service.

Aspose.Words for Java was my best bet, however it also returned UnsupportedDocumentFormat exception for WordML. First I thought it could be my document but all other documents failed too then follow up with Aspose showed despite the documentation, WordML in Java is not supported in current release (http://www.aspose.com/community/forums/248442/wordml-support/showthread.aspx#248442)

I would have gone the route of writing .Net service to do the conversion - but have quiet a few problems there as well - (a) My service [existing] runs on Solaris Box (b) MS doesn't recommends word automation in this way due to poor multithreading performance (c) Use Aspose.Words for .Net - however that means significant Hardware costs + .Net licenses etc.

I explored the possibility finding such possibility for WordML->RTF conversion but did not find suitable library for that either. Apart from the fact that WordML would include some hefty charts which we do not know yet are supported in RTF and we cannot find out either since only WordML is available to us at the moment with Word 2002 installation.

So, it comes to this:
Is there any library other than Aspose.Words for Java available to do WordML->Word2002 [or rtf] conversion which does not depend on Windows host doing anything (leave alone actual MS Word installation).

Apologies for long question, but I really am not able to figure out any option. Any help/suggestion/pointers to suitable library will be very useful. Paid libraries might be okay as long as we have the option to try it out before hand to make case to project sponsor.

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

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

发布评论

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

评论(2

鹿! 2024-09-16 22:15:19

您可以使用 Apache POI 来满足您的需求。它方便开发人员读取和编写Microsoft OLE 2 复合文档。但它不读取或写入 RTF 文档。您可以从 WordML 读取以 Word 2002 格式写入。尝试一下...

You can accomplish your need with Apache POI. It facilitates developers to read and write Microsoft OLE 2 Compound Documents. But it doesn't read or write RTF Documents. You can read from WordML and write as Word 2002 format. Give it a try...

沒落の蓅哖 2024-09-16 22:15:19

docx4j 可以读取 2007 WordML。您可以尝试通过 FOP 或 iText 用它编写 RTF(我自己还没有尝试过)。

docx4j can read 2007 WordML. You could try writing RTF with it, via either FOP or iText (I haven't tried this myself).

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