[reportlab-users] FW: linkAnnotate and linkRect, relative to transforms

Tim Roberts timr at probo.com
Thu Apr 12 13:35:45 EDT 2007


Ian Sparks wrote:

>

>

>

> Finally. I thought scaling and transforms were supposed to be

> additive? My last example I scale by 50% then move 5 inches up.

> Doesn’t look like anything is scaled anymore?

>


Yes, transforms accumulate. However, I think you are being fooled by
that very effect:



> canv = canvas.Canvas('test.pdf')

>

> canv.bookmarkPage('t1')

>

> canv.setFont('Courier',20)

>

>

>

> #Test page

>

> makePage(canv,'Normal')

>

>

>

> #Make 50% smaller

>

> canv.scale(0.5,0.5)

>

> makePage(canv,'50% Scaled')

>

>

>

> #Move origin up 5 inches

>

> canv.translate(0,5*inch)

>

> makePage(canv,'Scaled and moved 5 inches up')

>


This does *not* move the origin 5 inches up. It moves the origin 2.5
inches up, because everything is already scaled down by 50%. You might
want to do these in the opposite order...

--
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the reportlab-users mailing list