473,320 Members | 2,104 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Printing a Tk canvas under windows

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.

Jul 18 '05 #1
0 1413

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

Similar topics

1
by: uri bushey | last post by:
So I have a tkinter based little program in Python that has a canvas loaded with a WaveSurfer (http://www.speech.kth.se/wavesurfer/) widget. I am trying to print the contents of the WaveSurfer...
0
by: Jim & Joanne Collins | last post by:
Craig, Thank you very much for your response. I've interspersed my questions in your reply. If you have answers to my question I would be extremely gratefull for your assistance! Thanks.
6
by: mphanke | last post by:
Hi, I'm desperately trying to print a string on top of an image, but for whatever reason the images allways stays on top of my canvas! Is there some trick how to implement things? I call ...
3
by: Ahmad Abu-Raddad | last post by:
Hey Guys, Does anyone knows of a way to print HTML source directly to the printer (Server Side)?. I tried the PrintDocument class and the e.Graphics.DrawString and e.Graphics.DrawImage() but...
2
by: Kevin | last post by:
In my VB2005 Windows Forms program I want to be able to click a button and have my Dot Matrix printer print one 15/16 x 3 1/2 address label from continuous forms. I'm trying to use a...
5
by: Andrew Poulos | last post by:
Is there a right/best way to draw an ellipse using Canvas? (With VML there's the v:oval element which makes the exercise trivial). I tried drawing a 360 degree arc (a circle) and then scaling it...
0
by: v.davis2 | last post by:
Hi all, I have searched a bit for this -- both in the newsgroup and Google -- No luck. How do I print a Tk Canvas object under Windows? No, I do NOT want to generate the Postscript and do it that...
26
by: Jon Davis | last post by:
OK, why is Canvas not IDisposable, and how do I get rid of all the Windows handles? I'm doing a performance test of looping through a dynamic XAML-to-JPEG conversion. It gets to about 500...
6
by: Nebulism | last post by:
I have been attempting to utilize a draw command script that loads a canvas, and through certain mouse events, draws rectangles. The original code is from...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.