使用 Java 将 Word 文档隐藏为 XSL-FO

发布于 2024-08-22 13:56:03 字数 126 浏览 1 评论 0原文

我正在尝试使用java将word文档转换为pdf。 “word to XSL-FO to pdf”是我正在寻找的方法。

在这种“word to XSL-FO”方法中,是否有可用的开源 API?或者您能指导我实施它的步骤吗?

I am trying to covert a word document to pdf using java. 'word to XSL-FO to pdf' is the approach i am looking at.

In this approach to do 'word to XSL-FO', is there any open source api available? or can you please guide me with steps for implementing it?

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

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

发布评论

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

评论(4

三人与歌 2024-08-29 13:56:03

您要转换哪个版本的 Word 文档?

RenderX 具有公开的 WordML2FO 样式表,可以转换 Microsoft 的 WordprocessingML将文档转换为 XSL FO (XSLFO)。

这些样式表是由
RenderX的开发团队和
微软一般用途。他们是
用于转换文档
Microsoft 的 WordprocessingML XML
将词汇转化为 W3C 的文档
XSL FO (XSLFO) 词汇。

What version of Word document are you converting?

RenderX has WordML2FO stylesheets publicly available that can convert Microsoft's WordprocessingML documents to XSL FO (XSLFO).

These stylesheets were prepared by
RenderX's development team and
Microsoft for general use. They are
used to convert documents in
Microsoft's WordprocessingML XML
vocabulary into documents in the W3C's
XSL FO (XSLFO) vocabulary.

独留℉清风醉 2024-08-29 13:56:03

我完全认为仅使用样式表不是正确的方法,因为您会错过太多东西(例如解析样式、用于 docx/word2003 文档内图形的 DrawingML/VML 等)。
尝试这个代码示例并从那里开始。另请注意,如果您使用 Microsoft 的 API 生成 Word 2003/2007,则除非您进行所有必需的函数调用,否则它的结构可能不会始终正确。

I totally think that using just a stylesheet is not the way to go because there are too many things you will miss (like resolving styles, drawingml/vml used for the graphics inside a docx/word2003 document, etc).
Try this code sample and move from there. Also to note is that if you generate your Word 2003/2007 using Microsoft's API, the structure of it may not be correct all the time unless you make all the required function calls.

孤城病女 2024-08-29 13:56:03

docx4j(开源,Apache 许可证)可以为您做到这一点。

有关更多详细信息,请参阅 docx4j 入门指南。

docx4j (open source, Apache license) can do this for you.

See the docx4j Getting Started guide for further details.

雨巷深深 2024-08-29 13:56:03

您还可以尝试 DocmosisJODConverter 只要您可以在某处安装 OpenOffice 即可进行转换。它们可以在许多平台上运行并且可以由 Java 控制。

You could also try Docmosis or JODConverter to do the conversion as long as you can install OpenOffice somewhere. They work on many platforms and can be Java controlled.

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