Johannes
Johannes

Reputation: 275

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?

Upvotes: 6

Views: 3680

Answers (3)

Branden S. Smith
Branden S. Smith

Reputation: 1161

Pisa is a Html/CSS to PDF converter. It's a great tool for developing Pdf's from scratch using python.

If you need to just append Pdf Pages together, or search through Pdf data, then I'd suggest pyPdf it is free and pretty well documented and easy to use. You can download it here

Upvotes: 4

user2665694
user2665694

Reputation:

You may check the http://pypi.python.org/pypi/z3c.rml/ package as an implemenation of Reportlab's RML.

"best way" means? What are you requirements? Some PDF requirements can be accomplished with "cheap" open-source generators or you may end up with some commercial PDF converter. Higher quality means higher price.

Upvotes: 0

Amado Levey
Amado Levey

Reputation: 76

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!

Upvotes: 6

Related Questions