How it works...

The main addition to the original script is the Render canvas button with the render_canvas() callback.

It calls the postscript() method on the canvas instance with the file and colormode arguments. These options specify the path to the destination file that writes the PostScript and the output color information, which could be "color" for full color output, "gray" to translate to gray-scale equivalents, and "mono" to convert all colors to black or white:

    def render_canvas(self):
self.canvas.postscript(file="output.ps", colormode="color")

You can check all the valid options that can be passed to the postscript() method on the Tk/Tcl documentation at https://www.tcl.tk/man/tcl8.6/TkCmd/canvas.htm#M61. Bear in mind that PostScript is a language primarily aimed to be printed, so most options refer to page settings.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset