Printing a graphic

Steve Holden sholden at holdenweb.com
Mon Aug 12 14:11:28 CEST 2002


"Henry Steigerwaldt" <hsteiger at comcast.net> wrote in message
news:f13a5d36.0208101659.49b1783 at posting.google.com...
> To All:
>
> Some time ago, I was able to design a program in TCL\TK to plot
> weather observations on a map. The map was a .GIF file that the
> program loaded and displayed on the computer screen. Once displayed,
> the user would then select the parameter to plot, and the program
> would then plot the values.
>
> Displaying the map and the plotted values on a computer screen was
> fine, but it was a different story getting everything on the map to
> show up on a printed copy!
>
> I wanted the option for the user to select a button to print
> EVERYTHING on the map. However, I found out from a discussion group
> that the only thing that would print would be the original map that
> was first displayed. Any additional things that were displayed on the
> map interactively were "layers," and would not appear on the printed
> map. The only way to print everything (all layers) would be to first
> make a screen capture, and then print that to the printer.
>
So this was a web-based process, where the efficiency of feature-display was
achieved by adding features using additional layers or divs, can we assume?
(It's sufficient that this was web-based).

> Well, I never was able to do this without having to do a lot of manual
> things, such as starting a screen capture program, manually clicking
> on the screen to capture it, and then clicking on a button within the
> screen capture program to print it.
>
> Now I want to write a similar program IN PYTHON to plot values on a
> map, and be able to capture the screen and print EVERYTHING on the
> screen AUTOMATICALLY
> when a user selects a button. This is needed so one can refer to a
> printed copy, rather than tying up computer screen to see it. Oh, one
> other thing. I would like to be able to do this on a UNIX and LINUX
> system, and maybe even on a WINDOWS system.
>
> Do any of you have ideas on how to automate this process (i.e. one
> button click, a screen capture, and then printing the screen to the
> printer) in Python? Otherwise I might as well not write such a
> program. It would really help to have it though at my work!
>
> Sorry for the long winded discussion. Please keep things very basic,
> as I am not really a programmer per se.
>
While I'm not the best one to give advice on how to structure a graphics
program, the good news is that you will be maintaining your own image in
such a program, and so will be able to print it without having to resort to
such tricks.

There are a number of graphical frameworks you might use, Tkinter (which
comes with Python) and wxPython being the most familiar to me. Both can
print without too much trouble, so you should have a go if this program
would be useful.

regards
-----------------------------------------------------------------------
Steve Holden                                 http://www.holdenweb.com/
Python Web Programming                http://pydish.holdenweb.com/pwp/
-----------------------------------------------------------------------








More information about the Python-list mailing list