[reportlab-users] Bulleted text

Andy Robinson andy at reportlab.com
Wed Jun 28 17:03:31 EDT 2006


> So, in summary, here are my two questions:
> 
>    1. How can I turn asterisks in a text into bullets, and draw the
>       bullets to the canvas?
>    2. How can I make drawText append the text to the end of the last
>       drawText, and go to the next page if necessary? 
> 
> Thank you in advance for the assistance! It is greatly appreciated.

Get to grips with Platypus, the 'next level up'.  It is designed to 
handle paragraphs, paragraph styles, flow over pages and so on. 
Paragraph classes also have a 'bullet' feature so you can define the 
'bullet string'; this might be a special character.  you construct a 
sequence of paragraphs in a bulleted style, instead of drawing on the 
page yourself.

To start learning, examine the test scripts matching
   reportlab\test\test_platypus_*.py
and run them and look at their PDF output.  You will find examples of 
bullets.



Also, make sure you are on ReportLab 2.0 which accepts Unicode strings 
as input to just about everything.  Python DOES natively use Unicode if 
you work throughout with Unicode strings:

utext = unicode(text)
utext.replace(u'*', u'\N{BULLET}


Good luck,


- Andy



More information about the reportlab-users mailing list