Search the FAQ Archives

3 - A - B - C - D - E - F - G - H - I - J - K - L - M
N - O - P - Q - R - S - T - U - V - W - X - Y - Z
faqs.org - Internet FAQ Archives

comp.windows.x Frequently Asked Questions (FAQ) 2/7
Section - 26) How do I make a screendump or print my application (including menus)?

( Part1 - Part2 - Part3 - Part4 - Part5 - Part6 - Part7 - Single Page )
[ Usenet FAQs | Web FAQs | Documents | RFC Index | Neighborhoods ]


Top Document: comp.windows.x Frequently Asked Questions (FAQ) 2/7
Previous Document: 25) How do I remap the keys on my keyboard to produce a string?
Next Document: 27) How do I make a color PostScript screendump of the X display?
See reader questions & answers on this topic! - Help others by sharing your knowledge

The xwd client in the X11 distributions can be used to select a window or the
background. It produces an XWD-format file of the image of that window.  The
file can be post-processed into something useful or printed with the xpr
client and your local printing mechanism. To print a screendump including a
menu or other object which has grabbed the pointer, you can use this
command:

		csh% sleep 10; xwd -root > output.xwd &

and then spend 10 seconds or so setting up your screen; the entire current
display will be saved into the file output.xwd. Note that xwd also has an
undocumented (before R5) -id flag for specifying the window id on the
command-line. [There are also unofficial patches on ftp.x.org to xwd for
specifying the delay and the portion of the screen to capture.]

Note that xwd makes the assumption that it can make a single XGetImage call
and then decode the returned pixels via the associated colormap; the pixels
returned are undefined if the area you've selected includes multiple windows
with varying visuals, colormaps, or double-buffer states.

Two publicly-available programs which allow interactive definition of
arbitrary portions of the display and built-in delays are xsnap and xgrabsc.

xgrabsc is a free screendump program that provides multiple selection styles
and several output formats.  Selection styles include xwd-style point and
click, dragging a rectangle over an arbitrary portion of the screen, timed
snapshots for menu capturing, and keyboard-based selection.  Output formats
are xwd, XPM (v1 and 2), bitmap, puzzle, and monochrome, greyscale, and color
PostScript.  PostScript output can be in ready-to-print true-scale form or
encapsulated for inclusion in Frame, xfig, and other programs that accept EPS
graphics.  There are several versions of xgrabsc; version 2.3, available on
ftp.x.org [9/93] is the most recent.  xgrab, part of the package, is an
interactive front-end to xgrabsc.

xwpick (formerly xpick) (by Evgeni Chernyaev (chernaev@mx.ihep.su)) is
available on ftp.x.org as xwpick-2.20.tar.Z; it creates Level 2 color
PostScript dumps of X screens and can generate GIF, PICT, and other formats.
PostScript output is very small. xwpick runs under VMS and Unix systems.

xsnap includes some asnap features and supersedes it; it also renders XPM
output [version unknown]. It is available on ftp.x.org or avahi.inria.fr; see
xsnap-pl2.tar.Z.

A screen-dump and merge/edit program combining features of xwd and xpr is
available from vernam.cs.uwm.edu as xdump1.0.tar.Z.  Information:
soft-eng@cs.uwm.edu.

xprint, by Alberto Accomazzi (alberto@cfa.harvard.edu) is available from
cfa0.harvard.edu (128.103.40.1) as /pub/wipl/xprint.export-2.1.tar.Z.  The
package allows users to create encapsulated color PostScript files which will
print on any PostScript Level-1 compliant printer (black and white or
color).

To post-process the xwd output of some of these tools, you can use xpr, which
is part of the X11 distribution (moved to contrib in R6). Also on several
archives are xwd2ps and "import" (formerly XtoPS), which produce Encapsulated
PostScript with trimmings suitable for use in presentations (see
ftp.x.org:R5contrib/xwd2ps.tar.Z and
contrib/applications/ImageMagick/ImageMagick3.7.tar.Z). Also useful is the
PBMPLUS/Netpbm package on many archive servers; and the Xim package contains
Level 2 color PostScript output.

The xv program can grab a portion of the X display, manipulate it, and save
it in one of the available formats. ImageMagick has similar capabilities.

Also:

HP's capture tool (provided with MPower and SharedPrint) corrects some of
the problems xwd has with XGetImage.

Bristol Technology (info@bristol.com, 203-438-6969) offers Xprinter, an Xlib
API for PostScript and PCL printers; a demo is in
ftp.bristol.com:/pub/Demos/DE.

ColorSoft 9619-459-8500) offers OPENprint; the package includes a
screen-capture facility, image-processing, and support for PostScript and
non-PostScript printers.

Some vendors' implementations of X (e.g. DECWindows and OpenWindows) include
session managers or other desktop programs which include "print portion of
screen" or "take a snapshot" options. Some platforms also have tools which
can be used to grab the frame-buffer directly; the Sun systems, for example,
have a 'screendump' program which produces a Sun raster file.  Some X
terminals have local screen-dump utilities to write PostScript to a local
serial printer.

Some vendors' implementations of lpr (e.g. Sony) include direct support for
printing xwd files, but you'll typically need some other package to massage
the output into a useful format which you can get to the printer.

User Contributions:

Comment about this article, ask questions, or add new information about this topic:

CAPTCHA




Top Document: comp.windows.x Frequently Asked Questions (FAQ) 2/7
Previous Document: 25) How do I remap the keys on my keyboard to produce a string?
Next Document: 27) How do I make a color PostScript screendump of the X display?

Part1 - Part2 - Part3 - Part4 - Part5 - Part6 - Part7 - Single Page

[ Usenet FAQs | Web FAQs | Documents | RFC Index ]

Send corrections/additions to the FAQ Maintainer:
faq%craft@uunet.uu.net (X FAQ maintenance address)





Last Update March 27 2014 @ 02:12 PM