Creating a PDF from XML using XSL FO w/ Python

那年仲夏 提交于 2019-12-06 11:58:37

If you want to run XSLT programmatically with Python, you want lxml.

However, if you just need to create a .fo file from a defined XSL/XML pair, you might as well just use xsltproc, which is available on any Unix-y system on the command line, including OS X.

Once you have the .fo file, use Fop to transform that to PDF.

You may want to try XHTML2PDF. It's very easy to use. Create your XHTML template. Use Jinja2 (or similar) to fill in the template. Convert to PDF.

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