[reportlab-users] keepWithNext problem

Wietse Jacobs W.Jacobs at intersentia.be
Fri Nov 2 14:28:31 EDT 2007


Thanks for your quick respons.

On 11/2/2007 6:20:38 PM, Robin Becker wrote:

> I always hated keepWith next; this is a bug as presumably we

shouldn't.

I presume you mean you don't like the implementation? As a feature I
find
it very useful ;) .


> Are you really trying to keep a paragraph and a Drawing together? If

> so I think you need to use some other kind of container as Drawings

> are normally particularly nasty about what things can be set on them.


Ok, I'll try to wrap it (I believe there is a `box` method somewhere in
the examples).


> Now fixed in SVN (or perhaps a different bug is introduced)


I'll get the snapshot and try it out.


>> -----------------------------------------------------------

>> from reportlab.platypus import *

>> from reportlab.lib.styles import ParagraphStyle from

>> reportlab.graphics.shapes import Drawing, Rect

>>

>>

>> normal = ParagraphStyle(name='Normal',

>> fontName='Helvetica',

>> fontSize=8.5,

>> leading=11)

>>

>> header = ParagraphStyle(name='Heading1',

>> parent=normal,

>> fontSize=14,

>> leading=19,

>> spaceAfter=6,

>> keepWithNext=1)

>>

>> d = Drawing(400, 200)

>> d.add(Rect(50, 50, 300, 100))

>>

>> story = [Paragraph("The section header", header), d]

>>

>> doc = SimpleDocTemplate('test.pdf')

>> doc.build(story)

> .......

>

> --

> Robin Becker

> _______________________________________________

> reportlab-users mailing list

> reportlab-users at reportlab.com

> http://two.pairlist.net/mailman/listinfo/reportlab-users


--
-Wietse Jacobs


More information about the reportlab-users mailing list