[reportlab-users] <u> in Paragraphs; BaseDocTemplate
Igor Stroh
reportlab-users@reportlab.com
29 Jun 2003 17:54:06 +0200
Hi there,
first question:
I have something like this:
doc.append(Paragraph("<u>foobar</u>", stylesheet["Normal"]))
but the resulting text is not underlined, however, if I use <super> or
<i> then the results are just like expected. Is it a font matter?
The stylesheet uses "Helvetica"[1].
second question:
I'm used to the cartesian coordinates system to have it's origin at
upper left corner of the page, so I subclassed the Canvas class[2] and
fed the name of the new class to my document's template (BaseDocTemplate
instance) like this:
self.document.build(self.objects, canvasmaker=GVPCanvas)
the translation works quite well, I can see this, 'cos I draw a header
on each page and the header uses the "bottomup" coordinates (otherwise I
would'nt see anything at all), but the rest of the data[3] added to the
doc isn't showing up...
What am I doing wrong here (except of using the depricated bottomup
parameter)?
TIA,
Igor
[1]:
stylesheet.add(styles.ParagraphStyle(name='Normal',
fontName='Helvetica',
fontSize=12,
leading=12))
[2]:
class GVPCanvas(Canvas):
def __init__(self, filename, pagesize):
Canvas.__init__(self, filename,
pagesize=pagesize, bottomup=0)
self.translate(60*mm, 49*mm)
[3]:
The data is added like this
objects.append(Paragraph("SomeText",
stylesheet["Normal"]))