473,583 Members | 2,878 Online
Bytes | Software Development & Data Engineering Community
+ 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.SetWorldTra nsform(0, -1, 1, 0, 0, 0)
command to rotate the print counterclockwis e 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.CreateP rintDialog(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 programmaticall y, 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 3004
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********@sym patico.ca> wrote in message
news:XE******** *************@n ews20.bellgloba l.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.SetWorldTra nsform(0, -1, 1, 0, 0, 0)
command to rotate the print counterclockwis e 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.CreateP rintDialog(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 programmaticall y, 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********@sym patico.ca> wrote in message news:<XE******* **************@ news20.bellglob al.com>...
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
13492
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 capture part. The code is as follows, the commented out lines at the end are things I have tried, but don't work. Whenever I try to create a...
1
5822
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() dc.CreatePrinterDC() dc.SetMapMode(4) # This is UI_MM_LOENGLISH # With this map mode, 12 points is 12*100/72 units = 16 font = win32ui.CreateFont({'name' :...
1
3976
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 it from Python or Pythonwin. I'm new to win32... and would appreciate any help I can get. If I comment out the following line it works fine but I...
8
4579
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 from embedded devices). Currently, we are using a heavyweight, proprietary log tool developed by another part of the company. This tool contains all...
4
3627
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 mine does is use os.system() to call the program. However, it needs to get an input file and an output file. Originally I was using just raw...
5
15710
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. import win32gui, win32ui, win32con, win32api hwnd = win32gui.GetDesktopWindow() print hwnd # you can use this to capture only a specific window
4
1509
by: MiguelS | last post by:
How do I display the contents of a file in a window using PyWin? Thanks, MS
2
4609
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 with my code ? How to print a document at a later stage and any errors in my code ? import win32ui import win32con myprinter_name = ""
0
1521
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 printed the script loads the next and I get the Memory Error. Each .jpg is between 40 and 75 mb. This script work with smaller (5 to 10mb) .jpg's....
0
7888
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8159
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8314
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7922
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5689
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5366
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3811
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2317
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 we have to send another system
1
1416
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.