Fraskito
Fraskito

Reputation: 109

Generate pdf in django

I'm making a web store and need to generate a pdf with orders. I've looked for, but it did not clarify what would be the best option to generate that.

Any advice of what library to generate pdf from html?

Upvotes: 0

Views: 3539

Answers (4)

Aventador
Aventador

Reputation: 217

ReportLab is a good solution to your problem.

http://www.reportlab.com/software/opensource/rl-toolkit/download/

from reportlab.pdfgen import canvas

Upvotes: 1

Hari Palappetty
Hari Palappetty

Reputation: 549

I noticed two options, they might be helpful:

The first one is official Django docs itself, here is the link https://docs.djangoproject.com/en/dev/howto/outputting-pdf/

Second one is from google code ( Django-report) please have a look, here is the link. http://code.google.com/p/django-report/

Upvotes: 0

Jakub Ječmínek
Jakub Ječmínek

Reputation: 487

I have experience with pisa http://pypi.python.org/pypi/pisa it works well for creating pdf from html. If you're using paver just add to your requirements.txt: pisa reportlab html5lib

Upvotes: 3

jpic
jpic

Reputation: 33410

xhtml2pdf works pretty well. However, it does not support 100% CSS.

You can find a working combo of HTML and CSS after little work, note that you should use tables for layout.

Upvotes: 3

Related Questions