[reportlab-users] Drawing an image in the background of a frame

Tim Roberts timr at probo.com
Thu Sep 26 13:33:49 EDT 2019

Lele Gaifax wrote:
> I'm asked if it would be possible to obtain something like the following
> sketch, where I have a frame with a "background" image and, in a specified
> area (a "subframe"), a superimposed list of flowables (paragraphs of text)
> with a "white" background:

Are you trying to do an automated magazine layout of some kind? That's 
an extremely difficult thing to automate.  People, as a rule, always do 
a better job of determining the visual appeal of a layout.

> The problem is that I should omit the image *iff* the flowables do not fit in
> the given area, possibly "trying" further combinations of image+flowables
> until one fits, so I cannot simply draw the image and then do a
> "subframe.add(flowable)".

There are some conflicting requirements here.  Does the size of the 
image represent a bounding box for the flowables?  If you omit the 
image, then what is the bounding box?  You said the flowables have to 
fit in a "specified area".  Is that area different for different 
images?  There are ways to determine the height of a flowable for some 
fixed width, and that may be all you need to know.

If you can document how a HUMAN would make these decisions, then you 
might be able to come up with a computer algorithm, but remember that 
the computer can't judge "eye appeal".

Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3389 bytes
Desc: S/MIME Cryptographic Signature
URL: <https://pairlist2.pair.net/pipermail/reportlab-users/attachments/20190926/9fdb5481/attachment-0001.bin>

More information about the reportlab-users mailing list