[reportlab-users] KeepInFrame.drawOn() working?

Dinu Gherman gherman at darwin.in-berlin.de
Tue Oct 3 11:26:19 EDT 2006

Robin Becker:

> I suspect KeepInFrame is intended to be used in a flowable context 
> where wrap is called. Since it's expected that it will never be split 
> or wrapped twice the wrap is assumed to be called just the once and 
> the calculations for width, height scaling are carried out there.
> Logically we should probably allow for all flowables to be wrapped 
> multiple times in different contexts, but pragmatically that hasn't 
> been done. In the drawOn method no information is directly available 
> as to the available space so it's hard to do the calculations there 
> anyway.

Is that a statement along the lines of "Better don't do that!
We would be surprised if that worked..."?

As I showed in my code you can add information about width,
height and content to a KeepInFrame instance. I found you can
also add the surroundigng canvas object as instance variable.

And after doing this in some cases it *does* work as expected.
So, it might only need a bit of work to get it work consistent-
ly... Sorry for my old consistency "disease" showing up again!


More information about the reportlab-users mailing list