[reportlab-users] fixed paragraph height?

Marcel Gsteiger Marcel.Gsteiger at milprog.ch
Tue Jan 30 07:42:00 EST 2007


I now added a new flowable in flowables.py:

class VertAlignBottom(Spacer):
"""Use up vertical space so that only a given space remains"""
def __init__(self, height):
self.height = height

def __repr__(self):
return "VertAlignBottom(%s)" %(self.height,)

def wrap(self, availWidth, availHeight):
if availHeight>self.height:
return (availWidth, availHeight-self.height)
return (0, 0)

....this did the trick.

Regards
--Marcel


>>> gherman at darwin.in-berlin.de 30.01.2007 >>>

Marcel Gsteiger:


> I need the opposite: a paragraph that occupies a fixed vertical space

> within a frame, even when it is shorter, but it should not fill up the

> entire frame. Perhaps I should use tables for this? I tried to put a

> space after the paragraph, but I was unable to get at the paragaphs

> real vertical size.


The opposite would be to "extend" a paragraph to reach a certain
height (quite interesting operation ;-). I imagine the UseUpSpace
flowable (bug report: no docstring ;-) fills a frame down to its
bottom. Maybe you try that one?

Regards,

Dinu

_______________________________________________
reportlab-users mailing list
reportlab-users at reportlab.com
http://two.pairlist.net/mailman/listinfo/reportlab-users



More information about the reportlab-users mailing list