[reportlab-users] horizscale and para

Martin Weissenboeck mweissen at gmail.com
Fri Jan 6 03:46:49 EST 2012


I have tried the following:

c.Canvas(filename)
f = Frame(...)
textobj = c.beginText(0,0)
textobj.setHorizScale(75)
c.drawText(textobj)
story=....
f.addFromList(story,c)
c.save()


Maybe this is a little bit complicated, but it shrinks the text as desired.
But:

- Calculating of line width does not work correct
- No page break - it needs a Template, right?

Martin Weissenboeck


2012/1/5 Robin Becker <robin at reportlab.com>


> On 05/01/2012 13:36, Martin Weissenboeck wrote:

>

>> From the manual, chapter 2.12:

>>>

>>

>> Horizontal Scaling

>> textobject.setHorizScale(**horizScale)

>> Lines of text can be stretched or shrunken horizontally by the

>> setHorizScale method.

>> ...

>> The horizontal scaling parameter horizScale is given in percentages (with

>> 100 as the default), so the 80

>> setting shown below looks skinny.

>>

>> .......

> .........

>

> OK so the intent is to expand/contract the letter spacing. I guess that

> would affect all of the width calculations so it might be a fairly large

> change. Presumably we would need to compute all string widths and multiply

> by the appropriate factor except where the object is fixed width eg images

> etc etc.

> --

> Robin Becker

>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://two.pairlist.net/pipermail/reportlab-users/attachments/20120106/564570c1/attachment.html>


More information about the reportlab-users mailing list