DAO
DAO

Reputation: 41

xml + xslfo to PDF python

Is there a simple way to get a PDF from a xml with an xsl-fo? I would like to do it in python. I know how to do an html from an xml&xsl, but I haven't find a code example to get a PDF.

Thanks

Upvotes: 1

Views: 1788

Answers (2)

Brecht Machiels
Brecht Machiels

Reputation: 3410

The rinohtype Python library can help you create a PDF from a structured document such as XML. You will need to write a frontend for your XML format to transform your document to a rinohtype document tree.

Rinohtype is not based on XSL-FO, but its CSS-like style sheets should allow for much easier styling of the PDF output.

(Full disclosure: I am the author of rinohtype)

Upvotes: 0

Kevin Brown
Kevin Brown

Reputation: 8877

XSL FO requires a formatting engine to create print output like PDF from XSL FO input. Freely available one is Apache FOP. There are several other commercial products also. I know of no XSL FO engines written in Python though some have Python interfaces.

Upvotes: 1

Related Questions