How to convert xsl-fo to docx (Office Open XML) in Java?

空扰寡人 提交于 2019-12-04 19:39:08

Alternatively, you could do: your source xml -> docx -> xsl-fo -> pdf.

or easier perhaps: source xml -> Flat OPC XML -> xsl-fo -> pdf.

Once you have a docx (or a Flat OPC XML document), transforming that to PDF via FOP is easy with docx4j (since you mention FOP, I'm assuming Java is ok for you).

The benefit of this approach is that you style your output docx as desired, and get the xsl fo "for free".

Flat OPC XML is convenient, because it is docx as a single XML file (ie no need to unzip). So you can create it easily via XSLT. To see it, create a document in Word 2007, and choose "save as .. xml".

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!