[reportlab-users] Is borderPadding supposed to do this?

Andy Robinson andy at reportlab.com
Fri May 29 10:52:13 EDT 2009

2009/5/29 Roberto Alsina <ralsina at netmanagers.com.ar>:

> I expected to see two largish paragraphs in ugly colours, with big padding,

> one below the other.

> What I got was the second paragraph drawn over the first one.

We don't support the browser "box model" and if you created a
paragraph with a really fat border ("borderWidth"), the border line
would extend into the ones above and below.

This made some sense with border lines, but I accept that your example
makes it look silly for an attribute called "borderPadding". This was
done to control the extent of the background colour, as the 'natural'
bounding box of a paragraph doesn't look natural if you want, say, a
black heading on a grey background bar. Unfortunately it was done 2
years ago and is in use in a fair number of projects - usually to have
a heading set against a solid text bar with controllable padding - so
changing it now would probably break real documents. Paul has
suggested the workaround.

For ReportLab 3000 we'll probably use CSS semantics - assuming they
have stabilised in 991 years time...

- Andy

More information about the reportlab-users mailing list