Update: A better explanation: the first bit of code sends the canvas data in postscript form to a (unix) printer lpr. The second bit of code creates a postscript file that you can send to the printer directly via11.7. How do I get a Canvas to output PostScript(c)? Many thanks to Tom Oelke <tpo9617@rit.edu> for providing this questio +n, answer & snippet of code: The following section of code gets the postscript code for the secti +on of canvas that's top-left corner is at $min_x, $min_y, and has a width +and height equivalent to the displayed region. This ps code is then pipe +d out to lpr to be printed. my $ps = $canvas->postscript( '-x' => $min_x, '-y' => $min_y, -width => $canv->Width, -height => $canv->Height); open (PS, "| lpr"); # customize with -Pname e.g. print PS $ps; close (PS); Whereas you would use something like: open (PS, ">file.ps"); # to output to a file print PS $ps; close (PS);
or you can open it with ghostscript to print it on a non-postscript printer.% lpr file.ps
-Mark
In reply to Re: Printing a TK Canvas
by kvale
in thread Printing a TK Canvas
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |