ECN No Name Newsletter: January, 1993

The ECN No Name Newsletter is no longer being published. This is an archived issue.

[previous article] [next article]

Sun Screendumping

NO NAME NEWSLETTER-- January 1993

Sam Kimery and Stacey Clark


The standard X11 Release 5 distribution comes with a complete system for generating screendumps and printing them. The xwd command is used to take a "snapshot" of an X11 screen or window. Snapshots taken with the xwd command are in a special format that other X11 tools can read and write. To translate a xwd file to Postscript so that it may be printed on a Postscript printer, the xpr command is used. For example the following would take a snapshot of the entire screen and print it on the msa printer.

                   xwd -root | xpr | lpr -Pmsa

The image is scaled to fit on the printed page. To take a snapshot of a window, the -root flag is omitted from the xwd command line:

                      xwd | xpr | lpr -Pmsa

At this point, the mouse pointer changes to a crosshair shape (similar to a plus sign), and you are required to click the mouse in the window that you wish to capture.

Another method for getting a hardcopy of your terminal screen is to use the older screendump command that came with the Suntools release. WARNING: It is unknown at this time how long Sun will continue to support this command.

On a color Sun, to screendump to a LaserWriter or an Imagen that accepts postscript (like ki3 or ci2) you type:

   screendump -e | rasfilter8to1 | psraster -i | lpr -Pci2 -l

On a monochrome Sun, you can use:

              screendump | psraster -i | lpr -Pci2

There is also an unsupported program called xgrabsc which grabs rectangular screen images. The following would dump the whole screen and print it on the ci2 printer.

                 xgrabsc  -root -eps | lpr -Pci2

The default Postscript output attempts to scale the image so that it will all fit on one page and is centered. If you are grabbing images to include in documents, you should ask for Encapsulated Postscript output with the -eps switch. The -o flag specifies that the output should be saved in the file named (image1.eps in this example).

                   xgrabsc -eps -o image1.eps

There are many details and options concerning screendumps not covered in this article. Type "man xwd", "man xpr" and "man xgrabsc" for more information.


webmaster@ecn.purdue.edu
Last modified: Friday, 12-Sep-97 19:16:21 EST

[HTML Check] HTML