XPR(1) XPR(1)
NAME
xpr - print an X window dump
SYNOPSIS
xpr [-scale scale] [-height inches] [-width inches]
[-left inches]
[-top inches] [-header string] [-trailer string]
[-landscape]
[-portrait] [-rv] [-compact] [-output filename]
[-append filename]
[-noff] [-split n] [-device dev] [filename]
DESCRIPTION
xpr takes as input a window dump file produced by
xwd(1) and formats it for output on the LN03, LA100,
IBM PP3812 page printer, or on any PostScript-equipped
printer. If no file argument is given, the standard
input is used. By default, xpr prints the largest
possible representation of the window on the output
page. Options allow the user to add headers and
trailers, specify margins, adjust the scale and
orientation, and append multiple window dumps to a
single output file. Output is to standard output
unless -output is specified.
Command Options
-scale scale
affects the size of the window on the page. The LN03
and PostScript printers can translate each bit in a
window pixel map into a grid of a specified size.
For example, each bit might translate into a 3x3
grid. This would be specified by -scale 3.
By default, a window is printed with the largest
scale that will fit onto the page for the specified
orientation. The value of scale is limited to the
integers 1, 2, 3, 4, 5 and 6; asking for any other
value results in rounding to the closest available
value, which is usually 6.
-height inches
specifies the maximum height of the window on the
page. Constraining the window image height is
accomplished by modifying the value of the scale
factor, which is an integral value, so the resulting
height of the printed image is not always what is
expected.
-width inches
specifies the maximum width of the window. Modifying
the width of the window image is done by modifying
- 1 -
XPR(1) XPR(1)
the (integer) scale factor.
-left inches
specifies the location of the left margin (in inches)
from the left edge of the page. Fractions are
allowed. By default, the window is centered in the
page.
-top inches
specifies the location of the top margin for the
picture (in inches) from the top of the page.
Fractions are allowed.
-header header
specifies a header string to be printed above the
window. A fixed amount of space is allocated for the
header string, and the scale factor is modified to
include this space; thus, window dumps do not always
appear as large as you thought you asked for.
-trailer trailer
specifies a trailer string to be printed below the
window. As above, a fixed amount of space is
allocated in which to print the trailer string, and
the scale factor is modified accordingly.
-landscape
forces the window to be printed in landscape mode.
By default, a window is printed such that its longest
side follows the long side of the paper.
-portrait
forces the window to be printed in portrait mode. By
default, a window is printed such that its longest
side follows the long side of the paper.
-rv
forces the window to be printed in reverse video.
This option only works for monochrome displays and
XYBitmap format image files.
-compact
uses simple run-length encoding for compact
representation of windows with many white pixels.
Only available with the -device ps option; not
available for ZPixmap format images.
-output filename
specifies an output filename. If this option is not
specified, standard output is used.
-append filename
- 2 -
XPR(1) XPR(1)
specifies a filename previously produced by xpr to
which the window is to be appended.
-noff
When specified with -append, the window appears on
the same page as the previous window.
-split n
allows the user to split a window onto several pages.
This might be necessary for very large windows that
would otherwise cause the printer to overload and
print the page in an obscure manner.
-device device
specifies the device on which the file will be
printed. Currently, only the LN03 (-device ln03),
LA100 (-device la100), PostScript printers (-device
ps), and IBM PP3812 (-device pp) are supported.
-device lw (LaserWriter) is equivalent to -device ps
and is provided only for backwards compatibility.
SEE ALSO
xwd(1), xwud(1)
LIMITATIONS
The current version of xpr can generally print on the
LN03 most X windows that are not larger than two-thirds
of the screen. For example, xpr can print out a large
Emacs window, but it usually fails when trying to print
out the entire screen. The LN03 has memory limitations
that can cause it to incorrectly print very large or
complex windows.
The two most common errors encountered are band too
complex and page memory exceeded. In the first case, a
window may have a particular six pixel row that
contains too many changes (from black to white to
black). This causes the printer to drop part of the
line and possibly parts of the rest of the page. The
printer flashes the number 1 on its front panel when
this problem occurs. A possible solution to this
problem is to increase the scale of the picture or to
split the picture onto two or more pages.
The second problem, page memory exceeded, occurs if the
picture contains too much black or if the picture
contains complex half-tones such as the background
color of a display. When this problem occurs, the
printer automatically splits the picture into two or
more pages. It may flash the number 5 on its front
panel. There is no easy solution to this problem. It
- 3 -
XPR(1) XPR(1)
will probably be necessary to either cut and paste or
to rework the application to produce a less complex
picture.
xpr provides some support for the LA100. However,
there are several limitations on its use: the picture
will always be printed in portrait mode, there is no
scaling, and the aspect ratio will be off slightly.
Support for PostScript output currently cannot handle
the -append, -noff or -split options.
The -compact option is only supported for PostScript
output with XYBitmap and XYPixmap images. It is not
supported for ZPixmap. It compresses white space but
not black space, so it is not useful for reverse-video
windows.
xpr assumes that the output device is a 300dpi device.
This may cause unexpected results when sending output
to a printer with better or worse resolution than
300dpi (this is possible with a PostScript printer, but
may not be allowed with other varieties).
GRAYSCALE AND LUMINANCE
When PostScript output and ZPixmap format screen dumps
are requested, the GSE version of xpr uses a luminance
formula to automatically calculate grayscale values
based on the red, green and blue pixel values in each
XColor entry in the colormap. This results in very
large PostScript output files. For example, a full-
screen image that is 1024 * 768 color pixels, depth 4,
can produce a PostScript output file that contains
786,432 bytes (plus PostScript program overhead). It
takes 15 minutes to send such a job over a 9600-baud
serial line.
AUTHORS
Michael R. Gretzinger (MIT Project Athena)
Jose Capo (MIT Project Athena (PP3812 support))
Marvin Solomon (University of Wisconsin)
- 4 -