[reportlab-users] question re: implementing Flowable.split()

Robin Becker robin at reportlab.com
Mon Sep 27 06:10:40 EDT 2010


........

> My question is as follows:

>

> In the case of returning a list with more than one element, why would

> implementers ever want to return a list of three or more elements

> rather than simply two? I ask because it seems like two would always

> be sufficient: the first element can be the largest flowable that fits

> in the available space, and client code can recursively call split on

> the second element.


I think the idea is as you suggest. In the case that a call to split is required
the doctemplate expects either an empty list or a list in which the first
element will fit in the allowed space; ie the split is [head,tail....]
where tail may be zero or more elements.



>

> Am I correct in assuming that the layout engine does call split() recursively?

>


If tail elements exist then they are injected into the story and will then be
treated as ordinary flowables, that does mean that split may be called on them.


> Also, if split() returns a list of three or more elements, does the

> engine simply use a greedy method when flowing the elements into a

> frame?


yes

>

> Thanks,

> --Chris

.......
--
Robin Becker


More information about the reportlab-users mailing list