Advanced printing using win32ui in python - help!

Darcy Kahle darcykahle at sympatico.ca
Fri Aug 6 19:39:34 EDT 2004


I am trying to do some advanced printing in python using the win32ui 
module, and have run into an issue.  I need to print a page landscape. 
As I could not determine how to specify the orientation of the printing, 
I arranged the graphic elements on the page the way it should be.  When 
I got to printing text, it went across the page, not down as I need it 
to go.  I tried to use the hDC.SetWorldTransform(0, -1, 1, 0, 0, 0) 
command to rotate the print counterclockwise 90 degrees, but this 
command was virtually ignored.  The other solution that I can see 
involves specifying that the page is in landscape mode, but as I 
indicated earlier, I cannot determine how to accomplish this.  The 
command win32ui.CreatePrintDialog(1538).DoModal() presents the dialog 
where the user can specify landscape mode, but it appears that the OK 
button is not hooked up to a default callback.  There is a PyCPrintInfo 
object, which it looks like I can set this programmatically, and then 
generate the printerDC object, but there is no documentation on how to 
generate this.

Can anyone recommend to me how I could either specify the page to be in 
landscape mode, or rotate the text that is printing?  Any assistance 
that you can provide is greatly appreciated, and I am certain that there 
are others out there that want to know how to do this as well.

BTW, I am currently using WinXP and Python 2.3, but the solution should 
be accessible via Win98 and up.  I plan to use py2exe to run the final 
product on other windows boxes.



More information about the Python-list mailing list