[reportlab-users] Does <br /> not work in Paragraphs?

Michael Hipp Michael at Hipp.com
Thu Jul 2 15:41:41 EDT 2009


def _upper_right(self, canvas, doc):
canvas.saveState()
letterhead = """
<font size=8>
Acme Rocket Shoes, Inc.<br />
31 Dead Coyote Road<br />
Phoenix, AZ 71111<br />
901-333-1234 Fax: 901-333-5678<br />
"""
lh = Paragraph(letterhead, self.normal)
w,h = lh.wrap(1, 1) # Find required space
lh.drawOn(canvas, self.rightEdge-w, self.topEdge-h)
canvas.restoreState()

The above code just wraps the lines of the address as if the <br/> wasn't
there. Am I doing something wrong or is <br> <br>oken?

I'm using 2.3 on WinXP in Py 2.5.4.

Thanks,
Michael


More information about the reportlab-users mailing list