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

Robin Becker robin at reportlab.com
Tue Apr 18 09:49:12 EDT 2017


I think you might not be specifying a height for the row in question. By default 
the width of a paragraph is the same as aW (in this case aH). We improved 
paragraph wrapping in later reportlab so this is just exposing a bug in how 
layouts used to fail ie the old case didn't wrap properly and then wrote outside 
the actual height of the cell. Since paragraphs don't ask for extra width the 
dynamic row height mechanism isn't going to help.


On 18/04/2017 12:58, Arkadi Colson wrote:
> 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
>
>
>
> _______________________________________________
> reportlab-users mailing list
> reportlab-users at lists2.reportlab.com
> https://pairlist2.pair.net/mailman/listinfo/reportlab-users
>
-- 
Robin Becker




More information about the reportlab-users mailing list