Problems generating PDFs with drawText()

Marius Flage <[email protected]>
Newsgroups gmane.comp.python.reportlab.user
Message-ID <[email protected]>
Hi!

I wrote a small script to generate invoices from GNUCash with reportlab, 
but haven't been able to use it for the last couple of years. Firstly 
because an error with the drawOn and Table methods which outputted 
nothing. After an upgrade to the latest version of reportlab, then 
tabular data started working again and I could use these methods again, 
but now drawText() has stopped working. drawString() works fine, but 
drawText() outputs nothing in the PDF document.

Here's my code:

from reportlab.lib.units import mm
from reportlab.lib import colors
from reportlab.lib.pagesizes import A4
from reportlab.pdfgen import canvas
from reportlab.platypus import *
from reportlab.rl_config import defaultPageSize
from reportlab.lib.styles import getSampleStyleSheet

c = canvas.Canvas("test.pdf", A4)

# company information
text = c.beginText()
text.setTextOrigin(150*mm, 282*mm)
text.textLines("""test dwkmflwkmfw
telkmtlwkmtw
tlkmewltmwt""")
c.drawText(text)

c.showPage()
c.save()

---------

But test.pdf is empty. Any idea? I'm running the latest version of 
reportlab as installed from pip install reportlab.

- Marius
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.