[reportlab-users] Background colour for part of a frame ?
Richard Shea
rshea at thecubagroup.com
Tue Dec 18 06:26:18 EST 2012
Hi - I have a frame into which I load a set of flowables. I want part of
this frame to have a background colour (other than white).
So here's the frame and the Z's are where the flowables which need a
background colour appear, the X's are where the background colour should
be white.
X
X
Z
Z
Z
Z
Z
X
X
The colour needs to be continous (ie no gap between individual
flowables) and the flowables, needing a background colour, in use (in
order) are :
Table
HRFlowable
Spacer
Paragraph
Spacer
Image
Spacer
Table
Each flowable occupies 100% of the Frame width.
What's the best way to do this ?
I can set a background colour in the : Table and Paragraph
The image has a background colour which matches the desired background
But how can the HRFlowable and Spacer be made to have a background
colour which matches the other flowables ?
I have considered using a canvas.rect to draw underneath the flowables
before the page is rendered but I can't figure out how to determine what
they coordinates of the flowables of interest will be after rendering
Any advice welcomed !
regards
Richard
More information about the reportlab-users
mailing list