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

Chris Jerdonek chris.jerdonek at gmail.com
Tue Sep 21 14:37:29 EDT 2010


Hi, I have a couple questions regarding subclassing Flowable and
implementing split().

The ReportLab User Guide says that the split method--

Flowable.split(self, availWidth, availheight)

should return a list of flowables. For example, the method should
return the empty list if the flowable is unable to split or [self] if
the space is sufficient.

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.

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

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?

Thanks,
--Chris


More information about the reportlab-users mailing list