473,473 Members | 2,243 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Advanced printing using win32ui in python - help!

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
2 2973
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Me Mine | last post by:
i, I have trying to code a small console app that will allow a user to select a window and then create a screen capture of the window. I haven't been able to figure out how to do the screen...
1
by: Serge Guay | last post by:
I have been trying to print a text file to my printer but the most I have been able to do is print one line. I have been using the following commands. dc = win32ui.CreateDC()...
1
by: EricP | last post by:
I get the following error when I run this script to open a file dialog. I've searched the web and news groups for this issue and have not found any references. I get the same behavior when I run...
8
by: Joakim Persson | last post by:
Hello all. I am involved in a project where we have a desire to improve our software testing tools, and I'm in charge of looking for solutions regarding the logging of our software (originating...
4
by: Joey C. | last post by:
Hello. I'm writing a program that creates a series of batch operations to convert movies to be used on iPodLinux. The programs that do the encoding and conversions are seperate from mine and all...
5
by: nobugus | last post by:
Just posting a solution to the problem of capturing the whole virtual screen area, including all monitors with python and pywin32. Because this doesn't work even with PIL's imagegrab module. ...
4
by: MiguelS | last post by:
How do I display the contents of a file in a window using PyWin? Thanks, MS
2
by: Raja | last post by:
Hi, Attached is the code . I want my program to save the current printer job properties and , when I reconnect the printer at a latter date , i need to print the saved job . Can you please help...
0
by: dekepler | last post by:
Hello all, I've written and used other's python scripts (You've probably seen it) to print a bunch of photos in *.jpg format and seem to be having an Memory Error problem. After the first image is...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.