[reportlab-users] Y-axis pointing down?

Tim Roberts timr at probo.com
Wed Feb 7 18:10:35 EST 2007


Justin Fagnani-Bell wrote:

> Is there an easy way to get the Y axis to point down? (I want to

> build my doc from the top down so it easily fits more than one paper

> size).

>

> If I use a negative scaling factor then my string will draw upside down.

>

> I could always subclass canvas, but I was wondering if there was a

> built-in way.

>


There is a "bottomup" attribute in the canvas class constructor that
enables this. Basically, it applies an extra [1 -1 0 0 0 0] transform
to every font you instantiate, so you can use a negative scale and still
see positive text.

However, if I may pontificate for a moment, you can still draw your
document from the top down without using this. You just have to start
the Y coordinate at pagesize-margin and subtract instead of starting at
0+margin and counting up. Starting at 0 doesn't relieve you of the
responsibility of worrying about page size; you still have to know where
the page ends, both horizontally and vertically.

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



More information about the reportlab-users mailing list