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

Robin Becker robin at reportlab.com
Tue Oct 3 11:39:55 EDT 2006


Dinu Gherman wrote:
> 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!
> 
> Dinu
.....
why not just use the 'preferred' route and call wrapOn with the intended canvas, 
width and height. Then at least the shrink would have a chance to do stuff.
-- 
Robin Becker


More information about the reportlab-users mailing list