[reportlab-users] Re: Getting the number of lines in a frame

Andy Robinson andy at reportlab.com
Tue Aug 22 08:37:22 EDT 2006


Saketh Bhamidipati wrote:
> 
> I need to create documents with headings on the left side and text on 
> the right side, the headings aligned with the text. 
> 
>     Perhaps you should say what you try to achieve - there
>     may be different ways to achieve your goals without the
>     need to count the number of lines.
> 
>     Henning
> 

Henning is right.  Pretend it's HTML!

Each time you need to create a new heading, make a two-cell table with 
one row.  Put a heading paragraph in the left cell, and as many 
paragraphs as you want in the right cell.  Then add this to the story.

This will also encourage the page breaks to happen in nice places, since 
a single table cell is never split.

Look at reportlab/test/test_platypus_tables.py and its output for 
examples of code to build tables.

Hope this helps,


Andy Robinson
CEO/Chief Architect



More information about the reportlab-users mailing list