|
|
|
|
SynopsisPrints the window to a file or the printer. Syntaxprint_window([ChipsId,] [filename [,attributes]]) Description
The print_window command prints the contents of the window to either a file or the printer. If "filename" is specified, the image is written to a file. If it is not specified, the image is sent to the user's default printer. New in CIAO 4.1: a GUI for printing ChIPS plots. If the preference "export.printdialog" is set to true, ChIPS will open a printing dialog box when print_window is called. The dialog allows you to decide whether to send the figure to the printer or to a file, and allows you to set all the printing options available in the print_window command (e.g. output format, color scheme, page margins). Unless a filename (with optional path) is specified in the print_window call, the working directory is used as the default location. The margins can be specified individually, along with the page orientation (portrait or landscape), the color scheme (e.g. rbg, cmyk), and the file format (e.g. postscript, jpg). A number of standard page sizes are available (e.g. letter, legal). The size and aspect ratio of the output matches the dimensions of the window. This can be overridden using the pagewidth and pageheight attributes or the pagesize attribute. The pagewidth, pageheight, and pagesize settings currently only work with postscript and pdf file formats. The scalewidth and scaleheight attributes scale the image with regard to the print area - either the window dimensions or the pagewidth/pageheight specification. If the image is scaled such that it's larger than the page and "keepaspect" is set to false, the image is clipped. If "keepaspect" is "true", the scaled image maintains the original aspect ratio and is scaled up until one dimension touches the margins. The units for the margins, width, and height are determined by the "window.units" preference, unless overridden by the pageunits attribute.
Example 2
chips> print_window("plot")A postscript version of the current window is created in the file plot.ps. Example 3
chips> print_window("plot",["pagesize","letter","fittopage",1])
chips> print_window("plot",["format","png"])A postscript version of the current window is created in the file plot.ps; it has been re-sized to fill a US letter page. The second call to print_window creates a PNG format of the window in the file plot.png. Example 4
chips> id = ChipsId()
chips> add_window("id=FirstWindow")
chips> add_window("id=Window2")
chips> id.window = "FirstWindow"
chips> print_window(id)Two windows are created; the second window is current after it is created. The id.window command sets the window value of the ChipsId structure to the first window. That window is then printed. Example 5
chips> add_window("id=MyWindow1")
chips> add_window()
chips> print_window("plot1", ["format","eps"])Two windows are created; the second window is current after it is created. That window is then printed to an EPS file named "plot1.eps". CHANGES IN CIAO 4.1GUI for printing ChIPS plotsIf the preference "export.printdialog" is set to true, ChIPS will open a printing dialog box when print_window is called. The dialog allows you to decide whether to send the figure to the printer or to a file, and allows you to set all the printing options available in the print_window command (e.g. output format, color scheme, page margins). Page margins changed to 0.2The default page margins were change to .2 to account for the margin which normally exists on printers. BugsSee the bugs pages on the ChIPS website for an up-to-date listing of known bugs. |
![]() |
The Chandra X-Ray
Center (CXC) is operated for NASA by the Smithsonian Astrophysical Observatory. 60 Garden Street, Cambridge, MA 02138 USA. Email: cxcweb@head.cfa.harvard.edu Smithsonian Institution, Copyright © 1998-2004. All rights reserved. |