[reportlab-users] Scaling and Translation

Andy Robinson andy at reportlab.com
Wed Jul 6 04:06:51 EDT 2005


> So My question : Is there a better, more global way to achieve this?

I'll lazily wave my hands rather than figuring this out explicitly
due to time pressure, but here's the general idea:  put the origin
where you want first, and draw "top down" with a negative height rect.

canv.saveState()
canv.translate(0, 10*inch)   #translate origin to TOP LEFT of where you want
canv.scale(0.5*inch, 0.5*inch)
canv.rect(0,0,inch,-inch) #Draw a negative-height box at origin
canv.restoreState()

HTH,

Andy




More information about the reportlab-users mailing list