473,508 Members | 2,805 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

FW: Printing images through Python

> From: Kevin [mailto:ot***@cazabon.com]
Sent: 04 October 2003 03:21
To: ti********@viacom-outdoor.co.uk
Subject: Re: Printing images through Python

Thanks for the help Tim, seems to work well!
Only too glad I could save someone the hours of frustrating
search it took me to get that far.
One problem I had though, just FYI:
turned out that printer_resolution[1] was a
function... have to do more looking to figure out why.
Blowed if I can see why; it's just the return value from GetDeviceCaps.
Ah... looking at my email to you underneath yours to me, the line has
been chopped (hope this makes it across the email systems) thus:

printer_resolution [...] = hDC.GetDeviceCaps [unintended line break]
(VERTRES)

which will make Python think that the second value in
the printer_resolution tuple is the function GetDeviceCaps
and that the (VERTRES) is merely a throwaway value.
It should, of course, read:

[...] = hDC.GetDeviceCaps (VERTRES)

where VERTRES is the parameter to GetDeviceCaps
I just used [0] for both args and it was fine(for now).


That'll work because, in any case, the code later on takes
the smaller of the two ratios to determine the scaling factor,
and printer_resolution[0] is the width of the page, which
is going to be the smaller of the two anyway.

Hope it works out for you. I haven't yet bothered to go
into using the Printer Setup dialogue, which truly is a
pain. I'm using a Pygame interface, so I'm trying to cut
down on Windows-esque dialog boxes.

TJG

__________________________________________________ ______________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
__________________________________________________ ______________________

Jul 18 '05 #1
0 1177

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1090
by: Kevin | last post by:
I've done a lot of searching to try to find a way to print PIL images to a normal (i.e. non-PostScript) printer through Python on a Windows system... and have found squat! The only sample I...
0
985
by: Jody Burgess | last post by:
The example in this post appears to be incomplete, -----Original Message----- > From: Tim Golden > Sent: 03 October 2003 09:49 > To: 'Kevin' > Cc: python-list@python.org > Subject: RE:...
19
3166
by: dcrespo | last post by:
Hi all... Is there a way to print a PDF file directly from Python without having Acrobat installed? I know about ReportLab. It's a python module that lets you create almost any PDF document, but I...
1
2678
by: Frank.Sebesta | last post by:
I have a employees database with a picture that shows on a form with employee information. Similar to the Northwinds sample database. When I print the record, my output is only the data and does...
6
3225
by: Chris Dunaway | last post by:
The method for printing documents in .Net can be confusing, especially for newer users. I would like to create a way to simplify this process. My idea would be implemented using a PrintDocument...
2
3021
by: letsgetsilly | last post by:
I'm developing the external corporate website for my company in Visual Studio 2003 using html, css, and a user web control for the header/navigation. When I try to print any of the pages only the...
4
1941
by: Prakash | last post by:
I'm developing an HR package which would contain the Employees Photo + upto 3 pages (pictures) of his Passport + pictures of his Driving License and Residence Card. If the user wants to print...
0
1676
by: gnewsgroup | last post by:
In my asp.net 2.0 web application. I create chart images on the fly by getting the data from the database. These chart images all have fixed width, but the height is dynamic depending on the...
0
7229
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
7129
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
7398
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...
0
7502
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
5637
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
5057
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
3208
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...
0
3194
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
769
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.