By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,677 Members | 1,060 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,677 IT Pros & Developers. It's quick & easy.

Advanced printing using win32ui in python - help!

P: n/a
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.
Jul 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
You may not want the additional overhead, but this is
pretty easy using wxPython (wxWindows Python package).
The additional benefit (which may not be important to
you) is that it is portable.

HTH,
Larry Bates
Syscon, Inc.

"Darcy Kahle" <da********@sympatico.ca> wrote in message
news:XE*********************@news20.bellglobal.com ...
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.

Jul 18 '05 #2

P: n/a
Darcy Kahle <da********@sympatico.ca> wrote in message news:<XE*********************@news20.bellglobal.co m>...
I am trying to do some advanced printing in python using the win32ui
module, and have run into an issue. [snip..]
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.


I'm afraid I don't have an answer for you..... but there is a big need
for a straightforward 'print module' for windows....

It's something I have on my list to look at 'sometime' - hopefully by
finding an existing library to wrap.

Regards,

Fuzzy

http://www.voidspace.org.uk/atlantib...thonutils.html
Jul 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.