[Tutor] Printing to a windows network printer

alan.gauld@bt.com alan.gauld@bt.com
Sat, 22 Sep 2001 18:02:36 +0100


> pipe.  I don't know any other way to programmatically print on a
> windows system ( I don't think "copy /b <foo> LPT1" really counts )

You can use GDI to print in Windows for true WYSIWYG style output.
Thats how the Windows textbooks tell you to do it - wrap your normal 
screen onPaint method with a printer device context...

The winall MFC classes should provide all the support you need along 
with an MFC textbook but its horrid and nothing to do with Python 
its how Windows does printing thats horrible.

In practice I usually format my code an some markup type language 
and use os.system to print it:
in postscript using ghostscript
in pdf (using pdfgen) and adobe acrobat or ghostscript
in html using a browser
in RTF and using word or wordpad

HTML is easiest but least powerful. However its enough for most things.

Alan g