[reportlab-users] Newbie -- How to center text in a paragraph
Henrique Romano
onaiort at yahoo.com.br
Thu Jun 22 16:17:19 EDT 2006
Jim Steil wrote:
>
> Hi:
>
> I’m REAL new to reportlab and am trying to center my text in a
> paragraph. I’ve found the XML markup and have the following code:
>
> styles = getSampleStyleSheet()
>
> style = styles['Normal']
>
> s5Text1 = '<para alignment="1"><i><b>QLF PRESERVATIVES AND MOLD
> INHIBITORS</b></i></para>'
>
> section5P1 = Paragraph(s5Text1, style)
>
> story5 = []
>
> story5.append(section5P1)
>
> frame5.addFromList(story5, canvas)
>
You can try using the "alignment" property of ParagraphStyle, or use
a style that is already aligned (like the 'Title' one).
--
Henrique
More information about the reportlab-users
mailing list