[reportlab-users] Bulleted Text not displaying
Peter Mattingly
pmattingly at mail.csuchico.edu
Mon Oct 13 15:23:32 EDT 2008
For fans of the XML approach this works for that application:
text = "<para leftIndent=32><bullet
bulletIndent=15>\xe2\x80\xa2</bullet>This is bulleted text.</para>"
para = Paragraph(text, style=body_style)
story.append(para)
I got the bullet character from the documentation; Who knows where they got
that, I certainly can't find any reference that that code / format when I
google it.
On Sun, Oct 12, 2008 at 11:05 PM, Henning von Bargen <H.vonBargen at t-p.com>wrote:
> > From: "Peter Mattingly" <pmattingly at mail.csuchico.edu>
> > Subject: [reportlab-users] Bulleted Text not displaying
> > To: reportlab-users at reportlab.com
> >
> > Code:
> > pdf = SimpleDocTemplate("learn_platypus.pdf",
> > pagesize = letter,
> > title="Somebody",
> > author="Somebody",
> > showBoundary = 0, #debugging, set to 1
> > )
> >
> > body_style = ParagraphStyle(
> > name = "body_style",
> > fontSize = 12,
> > wordWrap = True,#THIS DOES NOT REPORT ERRORS ON BAD INPUTS
> > #Does this even work?
> > fontName = "Times-Roman"
> > )
> > text = "<bullet>This is bulleted text.</bullet>"
> > para = Paragraph(text, style=body_style)
> > story.append(para)
> >
> > pdf.build(story)
> >
> > I'd really like to be able to display bulleted text, but
> > ReportLab isn't
> > cooperating. Other things I've tried that didn't work:
> >
> > text = "<bullet></bullet>This is bulleted text." #displays no
> > bullet, but
> > the text works
> > text = "\xe2\x80\xa2This is bulleted text." #displays a
> > bullet CHARACTER
> > then the text, not what I'm after
> > para = Paragraph("", style=body_style, bulletText="This is
> > bulleted text.")
> > #displays nothing
> > para = Paragraph("\xe2\x80\xa2", style=body_style, bulletText="This is
> > bulleted text.") #Bullet character AFTER the bullet text
> >
> > This is the last thing I need to get working before I can finish my
> > programming.
> >
> > Thanks for your help.
>
> The optional argument bulletText is not the content of your paragraph,
> but the bullet itself.
> For example, try
> para = Paragraph("Blah Blah Blubberfasel Blah", bulletText="a)",
> style=body_style)
> or
> para = Paragraph("This is bulleted text.", style=body_style,
> bulletText="\xe2\x80\xa2")
>
> Hint: Don't just read the documentation, also look at the tests folder
> (unfortunately not included in the Windows installer).
>
> Henning
>
> _______________________________________________
> reportlab-users mailing list
> reportlab-users at reportlab.com
> http://two.pairlist.net/mailman/listinfo/reportlab-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://two.pairlist.net/pipermail/reportlab-users/attachments/20081013/9fb12b93/attachment.htm>
More information about the reportlab-users
mailing list