[reportlab-users] precalculate size of textobjects, vector patterns?
Andy Robinson
reportlab-users@reportlab.com
Mon, 24 Mar 2003 09:26:25 -0000
> So, the question: is there a way to precalculate size parameters of
> textobjects and return these values to my application? This calculation
> should take into account the current text rendering settings. In the
> docs i haven't found yet such methods.
No, but you can do it with Paragraph objects and all other
flowables. Just tell it the allowed width (and a nice big height,
more thasn oyu need) and it will tell you what height it needs.
p = Paragraph(text, style...)
widthUsed, heightUsed = p.wrap(availableWidth, availableHeight)
>
> And one other, rather a feature question: Is it possible with reportlab
> to fill rectangles with vector patterns (e.g. .eps)?
Not done yet. It's allowed in the PDF spec but we have not had any call
for it.
Thanks,
Andy