Printing a Tk canvas under windows

G

Gordon Airport

I was surprised that I couldn't find enough information out there to get
this to work. Just enough to make a mess ;-). The code below just starts
spitting out what I guess is postscript code, seperated by line feeds
but not carrage returns, so they run right off the page. Certainly
nothing graphical.

....
printerName = win32print.GetDefaultPrinter()
printerHandle = win32print.OpenPrinter( printerName )
win32print.StartDocPrinter( printerHandle, 1, ("test", None, "raw" ) )
win32print.WritePrinter( printerHandle, canvas.postscript() )
win32print.EndDocPrinter( printerHandle )
win32print.ClosePrinter( printerHandle )

I got the same result with None instead of "raw".
The printer's an HP deskjet 930, if that helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top