Create PDF using python

I am trying to develop a small script that generate a complete new pdf, mainly text and tables, as a result. I am looking for a better way to do this.

I read about reportlab, which seems pretty good. As I can see, he has only one drawback. It's hard to write a template without a commercial version, and the code seems to be hard to maintain.

So, I was looking for a more suitable way and found xhtml2pdf, but this software is quiet and cannot generate tables of two pages or more.

The last solution, in my opinion, is to generate a tex file with a template framework, and then call pdftex as a subprocess.

I would use the latter and go through LateX. Do you do this, do you have any better ideas?

+6
source share
3 answers

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

+5
source

Pisa is an Html / CSS to PDF converter. This is a great tool to develop Pdf from scratch using python.

If you just need to add Pdf pages together or search through Pdf data, then I offer pyPdf , it is free and quite well documented and easy to use. You can download it here.

+3
source

You can check the http://pypi.python.org/pypi/z3c.rml/ package as an implementation of ReportLab RML.

"best way" means? What are your requirements? Some of the PDF requirements can be met with "cheap" open source generators or you can get a commercial PDF converter. Higher quality means higher price.

0
source

Source: https://habr.com/ru/post/921691/


All Articles