[reportlab-users] vertical text in table cell with height None

Arkadi Colson arkadi at smartbit.be
Tue Apr 18 07:58:45 EDT 2017


Hi

I'm using this function to rotate the text vertically:

class RotatedParagraph(Flowable):
         def __init__(self, text):
                 Flowable.__init__(self)
                 self.text       = text

         def draw(self):
                 canvas = self.canv
                 canvas.rotate(90)
                 fs = canvas._fontsize
                 canvas.translate(0, -(self.width/2) -(self.aW/2))
                 self.text.canv = canvas
                 try:
                         self.text.draw()
                 finally:
                         del self.text.canv

         def wrap(self, aW, aH):
                 self.aW, self.aH = aW, aH
                 w, h = self.text.wrap(aH,aW)
                 self.width,self.height = h, w
                 return h, w*1.1

Since we upgraded from reportlab 2.5 to 3.3 this is the result:


It looks like that the available height value has been changed. It's now 
a very high number. Any idea what's the problem here and how I can put 
vertically rotated text in a variable height cell?

Thanks!

BR
Arkadi

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist2.pair.net/pipermail/reportlab-users/attachments/20170418/0651e86a/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ojjebikeakibkojk.png
Type: image/png
Size: 7486 bytes
Desc: not available
URL: <https://pairlist2.pair.net/pipermail/reportlab-users/attachments/20170418/0651e86a/attachment.png>


More information about the reportlab-users mailing list