[reportlab-users] Rotated paragraph/document with ReportLab (vertical text)
Tim Roberts
timr at probo.com
Thu Oct 25 13:41:15 EDT 2012
Jesus Sanchez-Palencia wrote:
> Is there any documentation about what happens to the coordinates after
> we canvas.rotate(90) everything?
This is all part of PostScript, and it's all from a mathematical point
of view. A standard canvas has its origin at the bottom left, with X
increasing to the right, and Y increasing as you go up. For a 250 x 80
document:
+Y
(0,80) (250,80)
+-----------+
| |
| canvas |
| |
o-----------+ +X
(0,0) (250,0)
Positive rotation is counter-clockwise about the origin, so rotating by
90 degrees changes things so that Y increases to the left, and X
increases going up. The origin remains the same, so after this
rotation, all of the Y coordinates in the canvas will be negative.
That's why you often use a translation when you do a rotation:
+X
(250,0) (250,-80)
. - - - +-------+
: | |
: | |
: |canvas |
: | |
: | |
: | |
+Y . - - - o-------+
(0,0) (0,-80)
--
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.
More information about the reportlab-users
mailing list