Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating a PDF from XML using XSL FO w/ Python

Tags:

python

xml

xsl-fo

Could someone point me in the right direction of hopefully a library or code examples, any resources on how to take XML and create a PDF using XSL-FO in Python? If I should have to use an XML renderer, then which XML renderer is recommended?

like image 737
KacieHouser Avatar asked Dec 22 '25 07:12

KacieHouser


1 Answers

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.

like image 94
Liza Daly Avatar answered Dec 23 '25 21:12

Liza Daly