How to use Tkinter.canvas.postscript()?
Martin Franklin
martin.franklin at westerngeco.com
Thu Jul 5 06:02:30 EDT 2001
Take a look into the Tk commands help..canvas
I do like this but I can't remember which of these options do what.......
psfile.write(canvas2.postscript(fontmap='fontMap',
colormap='colorMap',
pageanchor='nw',
height='%2.1fc' %paper_height,
width='21.c',
pagex='0.c',
pagey='%2.1fc' %paper_height,
y='0.c',
x='0.c'))
XiaoQin Xia wrote:
>
> Hi, everybody,
>
> Here is some code to use Tkinter.canvas.postscript()
>
> from Tkinter import *
>
> win=Tk()
> win.title("A Chart ")
> canvas=Canvas(win)#, background="white")
> canvas.pack(padx=0, pady=0)
> # here is some code using canvas to draw some lines and words.
> p=canvas.postscript()
> f=open("chart.ps", "wb")
> f.write(p)
> f.close()
>
> The problem is, after type the command " lpr chart.ps", I got only a blank
> paper, instead of a chart I saw on screen.
>
> Cheers,
>
> Xiao-Qin Xia
>
More information about the Python-list
mailing list