[reportlab-users] Rotated Text

1,524 views
Skip to first unread message

Chris Hobbs

unread,
Mar 11, 2014, 4:54:24 PM3/11/14
to reportl...@lists2.reportlab.com
I'm sure that this question has been asked and answered dozens of times but I can find it neither in the FAQs, nor in the mailing lists (is there a search option for the mailing list?).

I need to place a line of text on the pdf canvas at a particular angle (say 37 degrees to the horizontal). In the user manual there is a tantalizing mention of 

 textobject.setTextTransform(a,b,c,d,e,f)

but no further mention of what a to f are.

Any help would be appreciated.

Chris Hobbs

Mike Driscoll

unread,
Mar 11, 2014, 5:14:13 PM3/11/14
to reportl...@googlegroups.com, reportlab-users, cw...@farmhall.ca


I found this example a year or so ago and it worked then:

http://www.local-guru.net/blog/2009/4/9/rotated-text-in-reportlabs

The canvas method you are looking for called rotate(). This StackOverflow link also has an example: https://stackoverflow.com/questions/13061545/rotated-document-with-reportlab-vertical-text

Hope that helps,
Mike
 

Chris Hobbs

unread,
Mar 11, 2014, 7:04:14 PM3/11/14
to Mike Driscoll, reportlab-users, reportl...@googlegroups.com
Many thanks. Worked almost like a dream. My problem was with the angle (which must be in degrees rather than radians).

Thanks again

Chris
Reply all
Reply to author
Forward
0 new messages