Generate a pdf with python

I’m trying to develop a small script that generate a complete new pdf, mainly text and tables, file as result.
I’m searching for the best way to do it.

I’ve read about reportlab, which seems pretty good. It has only one drawback asfar as I can see. It is quiet hard to write a template without the commercial version, and the code seems to be hard to maintain.

So I’ve searched for a more sufficient way and found xhtml2pdf, but this software is quiet old, and cannot generate tables over two pages or more.

The last solution in my mind it to generate a tex-File with a template framework, and later call pdftex as subprocess.

I would implement the last one, and go over LateX. Would you do so, have you better ideas?

Best answer

I would suggest using the LaTeX approach. It is cross-platform, works in many different languages and is easy to maintain. Plus it’s non-commercial!