Top Up Prev Next Bottom Contents Index Search

2.11 Hardcopy


There are several options for printing graphs and schematics developed under Ptolemy. The first option generates a PostScript1 description and routes it to a printer or file. The second uses the screen capture capability of the X Window system.

2.11.1 Printing oct facets

A block diagram under pigi is stored as an oct facet. To print it to a PostScript printer, first save the facet. Do this by moving the mouse to the facet and press the "S" key to save. The facet must be saved. Then, keeping the mouse in the facet, invoke the "print facet" command from the "Other" pigi menu. You will get a dialog box that looks like this:

Most entries are self-explanatory. The default printer is determined by your environment variable PRINTER, which you can set by putting the following line in your .cshrc file:

	setenv PRINTER printername
You will have to restart pigi for this change to be registered.

If you select the option "To file only", then PostScript code suitable for importing into other applications will be generated. The image will be positioned at the lower left of the page. The facets displayed in this document were generated this way and imported into FrameMaker. See chapter 18, "Creating Documentation" on page 18-1 for more information.

The "EPSI" option will create Encapsulated Postscript output. Note that you need to have GNU ghostscript installed to generate EPSI. See "Other useful software packages" on page A-14 for further information about GNU ghostscript.

2.11.2 Capturing a screen image

Under the X window system and compatible systems, there are facilities for capturing screen images. These can be used directly with Ptolemy. However, colors that work well on the screen are not always ideal for hardcopy. For this reason, two sets of alternative colors have been devised for use with black and white printers, these color sets are selected at startup with the pigi command line option -bw or -cp. For black and white printers, use the -bw command line option when starting Ptolemy, as in:

pigi -bw
The screen capture command can be used effectively. For example, under the X Window system, the following command will print a window on a black and white PostScript printer:

xwd | xpr -width 4 -portrait -device ps -gray 4 | lpr
If you wish to grab the window manager frame, then you can use:

xwd -frame > myfile.xwd
Other alternatives include a program called xgrabsc or some equivalent that may be available on your windowing system. A simple use of this is to generate an encapsulated PostScript image using the following command

xgrabsc -eps -page 4x2 -o mySchematic.ps
where "mySchematic.ps" is the name of the file into which you would like to store the EPS image. Then with the left mouse button, draw a box around the desired portion of the screen. This command will then save an encapsulated PostScript file four inches by two inches called mySchematic.ps. This file can then be used an a wide variety of document processing systems. To grab an entire window, including whatever borders your window manager provides, use the xgrabsc -click option.

Importing an image as PostScript

For example, to include this PostScript in a TeX document, include the command

\include{psfig}
in the TeX file and use the commands

\begin{figure} 
	\centerline{
	\psfig{figure=mySchematic.ps,width=4in,height=2in}} 
	\caption{Ptolemy Schematic} 
\end{figure}
To display the PostScript as a figure within a FrameMaker document.
The "print-facet" command can optionally generate a PostScript file suitable for inclusion in a FrameMaker document. Once you have generated this file, the preferred way to include it is as follows. First, create an anchored frame by using the "Anchored Frame" menu choice under the "Special" menu. The anchored frame will contain two disconnected text columns, one for the figure, the other for the figure paragraph that describes the figure. Create the first disconnected text column using the graphics tools. Then, put in the text box a #include line. For example, the text box might contain the following line:

#include /users/ptolemy/doc/users_man/figures/butterfly.ps
Unfortunately, the file must be specified using an absolute path, unless you always start FrameMaker from the same directory. With the cursor in the newly created text column, issue the command "Customize Text Frame" from the "Customize Layout" submenu in the "Format" menu, and select "PostScript code." When you print the document, you will get the following graphic:

The graphic will be anchored at the lower left of the text column you created.

The second disconnected text column is created in a similar fashion with the Graphics tool, but text is entered into the text column rather than the include directive.

It is possible, instead of using the #include line as above, to directly import the PostScript file into FrameMaker. However, this makes the text document very large, and the FrameMaker process appears to grow in size uncontrollably. Unfortunately, as of this writing, it does not appear possible to convert these PostScript files to encapsulated PostScript, which would have the advantage of displaying a semblance of the image.

Importing an Image as a X bitmap (XBM)

FrameMaker and some other text processing systems can import and print ordinary color X window dumps. To have these displayed in color on the screen, the following lines may need to appear in your X resources file:

Maker.colorImages: True 
Maker.colorDocs: True
One can use various programs, such as the FrameMaker 3.1 utility fmcolor and the Poskanzer Bitmap (PBM) tools to reduce a color window dump to a black and white window dump. This will save space and avoid any dithered imitations of color. However, since fmcolor applies a threshold based on color intensity to the image, some foreground colors may get mapped to white instead of black. To prevent this, use the -cp (cp stands for color printer) command line option when starting pigi, as in

pigi -cp
Then color window dumps can be converted to black and white window dumps using the following FrameMaker 3.1 command:

fmcolor -i 90 filein fileout
A useful hint when using such a document editor is to turn off the labels in pigi before capturing the image, and then to use the document editor itself to annotate the image. The fonts then will be printer fonts rather than screen fonts. To turn off the labels, execute the vem command "layer-display" under the vem "Options" menu.



Top Up Prev Next Bottom Contents Index Search

1 PostScript is a registered trademark of Adobe Systems Inc.

Copyright © 1990-1997, University of California. All rights reserved.