Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: Printing

Reply
Thread Tools

Re: Printing

 
 
Fredrik Lundh
Guest
Posts: n/a
 
      12-21-2004
Jim & Joanne Collins wrote:

> I've completed a semester of computer programming in Python
> and one thing we didn't learn was how to send data to a windows
> printer instead of the screen. I've also asked this question in one
> of the Python help places and received about three responses.
> None of them worked.


since you didn't tell us what responses you've always gotten, I guess
I have to provide more than three...

- write directly to the printer device (PRN, LPT1)

- write the output to a temporary file, and use the "print" command
to send it to the printer

out = open("temp.out", "w")
...
out.close()
os.system("print /D:LPT1 temp.out")

- use the win32 extensions, and talk to the GDI and spooler functions (see
Windows API documentation for details).

- use a printer aware UI toolkit, and draw on the printer instead of the screen

- use ReportLab or any other PDF-generating toolkit, and use Acrobat to
print it. (same as the second alternative, but generates nicer output):

os.system("start acrord32.exe /t /h temp.pdf printer")

if you try any of these and it doesn't work, let us know which one, and
what happened.

</F>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
brochure printing,online yearbook,printing,books printing,publishing elie Computer Support 2 11-27-2010 12:12 PM
brochure printing,online yearbook,printing,books printing,publishing elie Computer Support 0 08-21-2007 05:52 AM
brochure printing,online yearbook,printing,books printing,publishing elie Computer Support 0 08-21-2007 05:50 AM
brochure printing,online yearbook,printing,books printing,publishing elie Computer Support 0 08-21-2007 05:28 AM
brochure printing,online yearbook,printing,books printing,publishing elie Computer Support 0 08-18-2007 10:11 AM



Advertisments