Department of Computing Imperial College
How to save and print screen dumps

This is a method of printing screen dumps from X-windows.

type: xwd -out filename

(If you want to include the window frame, add the -frame option after the file name)

click on window to be dumped

type: xwdtopnm < filename | pnmtops -rle > filename.ps

(The -rle flag reduces the size of the generated postscript. It performs "run length" encoding on the image, this can often shrink the generated postscript to a tenth of its original size, at the expense of the printer having to do slightly more work to "decompress" the image when it prints it. )

If you want to save the file as a GIF so that you can insert the image into another document you need to use a different conversion:

type: xwdtopnm < filename | ppmtogif > filename.gif

If you have a colour screen dump that you wish to print on a black and white printer, you may also need to use the command ppmtopgm:

type: xwdtopnm < filename | ppmtopgm | pnmtops > filename.ps

To adjust the size use the -scale option with pnmtops

(e.g. -scale 2 to double the size, -scale .5 to reduce by half)

To preview output before printing:

type: gs filename.ps

To print:

type: lpr -Plwself filename.ps

See the manual pages for xwd, xwdtopnm, pnmtops and ppmtopgm for further options.

© CSG / 1999 / help@doc.ic.ac.uk