[reportlab-users] prevent paragraph splitting up

Remi Cool mailinglists at smartology.nl
Wed Jul 12 07:00:51 EDT 2006

Andy Robinson wrote:

> Remi Cool wrote:
>> Hello,
>> It's converted by a script to a sorta RML thats fed to platypus ....
>> that part works like a charm, except sections still get broken up so
>> that ie. the header is on one page and the text on the other. Is there a
>> way to let the paragraph know that it must not split so that the
>> complete section is printed on the next page?
> In your sorta-RML, make a sorta-one-cell-table.  This should "sort" it
> because table cells cannot be split yet ;-)
> <table><tr><td>
>    <h2>This is section 1</h2>
>    <p>This is section 1 text</p>
> </td></td></table>
> The code will look a bit yucky since you initialise a table with a 2d
> array of data.  And in this case the one-and-only cell should be a
> list of flowables.  Sort of like this
> tbl = Table([[[p1, p2, p3, p4...]]])
> story.append(tbl)
> Good luck,
> Andy
Thanks for the tip!!!

Maybe I can do something with  the KeepTogether flowable ... but that's
a tad more work then this quick solution.


More information about the reportlab-users mailing list