Jinja-like for Pdf in Python

Mamane picture Mamane · Jan 14, 2010 · Viewed 13.8k times · Source

I am looking for the best accurate tool for PDF in Python that works like Jinja does for HTML.

What are your suggestions?

Answer

Van Gale picture Van Gale · Jan 14, 2010

As answered by jbochi, ReportLab is the foundation for almost all Python projects that generate PDF.

But for your needs you might want to check out Pisa / xhtml2pdf. You would generate your HTML with a Jinja template and then use Pisa to convert the HTML to PDF. Pisa is built on top of ReportLab.

Edit: another option I'd forgotten about is wkhtmltopdf