Skip to Main Content
Learning Perl/Tk
book

Learning Perl/Tk

by Nancy Walsh
January 1999
Beginner content levelBeginner
373 pages
9h 43m
English
O'Reilly Media, Inc.
Content preview from Learning Perl/Tk

9.18. Rendering the Canvas as PostScript

You can get a copy of the canvas as postscript by using the postscriptmethod. It will either return the PostScript output or, if the -file option is specified, put it in a file:

$postscript = $canvas->postscript();
$canvas->postscript(-file => "ps.out");

The following options allow you to control the output of the PostScript.

-colormap => \ @array

Specifies that each element in @array must be a valid postscript command for setting color values; e.g., "1.0 1.0 0.0 setrgbcolor".

-colormode => "color" | "gray" | "mono"

Creates the postscript in full color, grayscale ("gray"), or black and white ("mono").

-file => filename

Specifies the file in which to put the PostScript output.

-fontmap => \@array

Each element in @array is a two-element array that contains a fontname and a point size. The fontname should be a complete font name so Tk will parse it correctly (e.g., "-*-Helvetica-Bold-O-Normal--*-140-*").

-height => size

Sets the height of the area to print. The default height is the canvas height.

-pageanchor => "n" | "e" | "s" | "w" | "center"

Indicates where the page should be placed over the positioning point specified by -pagexand -pagey options. Default is "center".

-pageheight => height

Sets the height of the printed page. The canvas image will be scaled to fit. height is any valid screen distance.

-pagewidth =>width

Sets the width of the printed page. The canvas image will be scaled to fit.

-pagex =>x

Sets the coordinate for the x ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering Perl/Tk

Mastering Perl/Tk

Stephen Lidie, Nancy Walsh

Publisher Resources

ISBN: 1565923146Supplemental ContentCatalog PageErrata