I can't seem to find a working tutorial or howto document for this module. Does one exist somewhere?
The "To be completed" section here: https://github.com/chrisglass/xhtml2pdf/blob/master/doc/usage.rst
is buggy, and doesn't seem to contain working code. After corrections, this code sequence:
from xhtml2pdf import pisa as pisa
filename = u'test.pdf'
pdf = pisa.CreatePDF("Hello <strong>World</strong>",file(filename, "wb"))
pisa.startViewer(filename)
produces an empty test.pdf file (well, not exactly empty, it's a pdf file without content)
Since it is heavily ReportLab based you may find their tutorials useful.
(I don't use either package).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With