[reportlab-users] Crop text outside frame?

Andy Robinson reportlab-users@reportlab.com
Wed, 21 May 2003 20:30:24 +0100


> > If my flowable doesn't wrap (Preformatted perhaps) inside a small frame,
> > the text prints outside (right side) the frame. I really don't 
> understand
> > how to deal with that... I just want to crop everything outside the 
> > frame... Is that possible? 

Are you talking about a custom flowable you wrote, or the
standard Preformatted class?  If Preformatted overflows
then it's a bug.  Please show us a snippet of code which
demonstrates this behaviour...  

If it's your own, it is your
responsibility to draw in the same space you specified
in the return from wrap(). If writing your own, the function 
stringWidth in  reportlab/pdfbase/pfdmetrics.py will give accurate
measurements of line length.


> 
> it is possible by creating a clipping path, but how to plug this
> in Platypus I don't know.
we haven't done that yet.  The logical way would be for each frame
to have a 'clip' attribute. But there are many occasions
when it is genuinely useful to draw outside the frame -
e.g. sidebar illustrations, or the pencil notes in our
user guide.

Andy Robinson