将 Word 文档转换为 XSL-FO
我正在使用 Microsoft Word 2007。我想将 Word 文档转换为 XSL-FO。网上有一些提示,但仅限于 RenderX。 Apache FOP 有这样的工具吗?
I am using Microsoft Word 2007. I would like to convert the Word document to XSL-FO. There are some hints on the net, but only for RenderX. Is there such a tool for Apache FOP?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
RenderX 有一组免费的 XSLT 样式表,用于转换 Microsoft 的 WordprocessingML将文档转换为 XSL FO (XSLFO)
这些公开可用的样式表可用于将 Microsoft 的 WordprocessingML 文档转换为 XSL FO (XSLFO)
您不必将生成的 XSL-FO 与 RenderX 一起使用。您可以运行它们来生成 XSL-FO 输出并在任何 XSL-FO 引擎(包括 Apache FOP)中呈现。
Antennahouse 还有一个 WordMLToFO 样式表,但它不是免费的(200 美元)
RenderX has a set of freely available XSLT Stylesheets for converting Microsoft's WordprocessingML documents to XSL FO (XSLFO)
These publicly available stylesheets can be used to convert Microsoft's WordprocessingML documents to XSL FO (XSLFO)
You don't have to use the generated XSL-FO with RenderX. You can run them to produce XSL-FO output and render in any XSL-FO engine (to include Apache FOP).
Antennahouse also has a WordMLToFO Stylesheet, but it is not free ($200)
docx4j 使用 FOP 从 docx 创建 pdf。
XSLT 位于 此处,但您可能更喜欢从 此 Web 应用程序开始,它可以发出来自上传的 docx 的 XSLFO。
它使用扩展函数来完成繁重的工作,因此它实际上仅作为 docx4j 的一部分工作,但它很容易获得并获得 ASLv2 许可。
是的,RenderX 有他们的 http://www.renderx.com/tools/word2fo.html但是许可证是有限制的,20070227版本是针对Word 2003 WordML(也许有更新的版本?我已经有一段时间没看过了)
docx4j uses FOP to create pdfs from docx.
The XSLT is in here, but you may prefer to start with this webapp, which can emit XSLFO from an uploaded docx.
It uses extension functions to do the heavy lifing, so it only really works as part of docx4j, but that's readily availableand ASLv2 licensed.
Yes, RenderX have their http://www.renderx.com/tools/word2fo.html but the licence is restrictive, and the 20070227 version is directed at Word 2003 WordML (maybe there is a newer one? its been a while since i looked)
Word 可以自己完成。以下是微软的说明:
http://msdn .microsoft.com/en-us/library/office/aa537167%28v=office.11%29.aspx#officewordwordmltoxsl-fo_creatinganxslfodocumentfromword
以下是所需 XSL - Word2FO.xsl 的下载链接:
http://www.microsoft.com/en-us/download /details.aspx?id=16876
Word can do it on it's own. Here are Microsoft's instructions:
http://msdn.microsoft.com/en-us/library/office/aa537167%28v=office.11%29.aspx#officewordwordmltoxsl-fo_creatinganxslfodocumentfromword
Here is the download link for the required XSL - Word2FO.xsl:
http://www.microsoft.com/en-us/download/details.aspx?id=16876
如果您需要 DOCX (Word 2007) 支持,您必须解压缩文件并合并各个资源才能使用样式表。这就是问题的一半,因为上次我检查样式表中存在严重的限制,例如样式/主题的处理、连续部分等。
如果您负担得起,商业DOCX 到 PDF 引擎可能正是您所需要的。
要记住的一件重要的事情是,通过 XSL-FO 传递实际上是不可行的,因为 XSL-FO 不提供对选项卡、图像周围文本的紧密环绕或其他 Word 功能的支持。
If you want DOCX (Word 2007) support you have to decompress the file and merge the individual resources in order to use the stylesheets. And that is half of the problem, because last time I checked there were severe limitations in the stylesheets like handling of styles/themes, continued sections and so on.
If you can afford it, a commercial DOCX to PDF engine may be what you need.
One important thing to remember is that passing through XSL-FO is really not feasible as XSL-FO doesn't provide support for tabs, tight wrapping of text around images or other Word features.
我不久前创建了一个报告工具,可以更改 RenderX XSLT,最初将 wordML 2003 转换为 XSLFO,以执行 wordML 2003 -> 。 XSLT,稍后与 XML 数据合并,最终生成带有模板+数据的 XSLFO。您需要在 Word 中创建模板,然后将生成的 XSLT 导入到 Web 应用程序并运行生成 XML 的查询并将其与您提供的模板合并。
https://github.com/juanmf/neatReports
文档
https://github.com/juanmf/neatReports/blob/master/doc/HowToReport .pdf
I created a while back a reporting tool that alters RenderX XSLT, that originally converts wordML 2003 to XSLFO, to do wordML 2003 -> XSLT, that later is merged with XML data to ultimately generate XSLFO with template + data. You needed to create your template in word, then import the generated XSLT to the web app and run the query that generates the XML and merges it with your provided template.
https://github.com/juanmf/neatReports
Documentation
https://github.com/juanmf/neatReports/blob/master/doc/HowToReport.pdf