[reportlab-users] Bulleted Text not displaying

Henning von Bargen H.vonBargen at t-p.com
Mon Oct 13 02:05:05 EDT 2008



> 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



More information about the reportlab-users mailing list