.TH xpr "" "" "X Client"
.PC "Print a dump of an X window"
\fBxpr [\-append \fIfilename\^\fB] [\-compact] [\-cutoff \fIlevel\^\fB] [\-density \fIdpi\^\fB]
	[\-device \fIdevtype\^\fB] [\-gamma \fIcorrection\^\fB] [\-gray] [\-header \fIstring\^\fB]
	[\-height \fIinches\^\fB] [\-landscape] [\-left \fIinches\^\fB] [\-noff]
	[\-noposition] [\-output \fIfilename\^\fB] [\-plane \fInumber\^\fB] [\-portrait]
	[\-psfig] [\-render \fIalgorithm\^\fB] [\-rv] [\-scale \fIscale\^\fB]
	[\-slide] [\-split \fIn\^\fB] [\-top \fIinches\^\fB] [\-trailer \fIstring\^\fB] [\-width \fIinches\^\fB] [\fIfilename\^\fB]\fR
.PP
.HS
.SH Options:
.IC "\fB\-append \fIfilename\fR"
Append the output to
.I filename
.IC "\fB\-compact\fR"
Use simple, run-length encoding for compact representation of windows
with lots of white pixels
.IC "\fB\-cutoff \fIlevel\fR"
Change the level of intensity by which
.B xpr
maps colors to black or
white for monochrome output on a LaserJet printer
.IC "\fB\-density \fIdpi\fR"
Set to
.I dpi
the dot-per-inch density to be used by a Hewlett-Packard printer
.IC "\fB\-device \fIdevtype\fR"
Print the output onto
.I devtype
.IC "\fB\-gamma \fIcorrection\fR"
Change the intensity of the colors printed by PaintJet XL printer
.IC "\fB\-gray 2|3|4\fR"
Uses a simple 2\(mu2, 3\(mu3, or 4\(mu4 gray-scale conversion on a color image,
rather than mapping to strictly black and white
.IC "\fB\-header \fIstring\fR"
Set a header string to be printed above the window
.IC "\fB\-height \fIinches\fR"
Set the maximum height of the page
.IC "\fB\-landscape\fR"
Print the window in landscape mode
.IC "\fB\-left \fIinches\fR"
Set the left margin, in inches
.IC "\fB\-noff\fR"
When specified with \fB\-append\fR,
the window appears on the same page as the previous window
.IC "\fB\-noposition\fR"
Bypass generation of commands for header, trailer, and image positioning
for LaserJet, PaintJet, and PaintJet XL printers
.IC "\fB\-output \fIfilename\fR"
Write the output into
.I filename
.IC "\fB\-plane \fInumber\fR"
Set the bit plane to use in an image
.IC "\fB\-portrait\fR"
Print the window in portrait mode
.IC "\fB\-psfig\fR"
Suppress translation of the PostScript picture to the center of the page
.IC "\fB\-render \fIalgorithm\fR"
Use
.I algorithm
to allow the Hewlett-Packard PaintJet XL printer to render the
image with the best ratio of quality versus performance
.IC "\fB\-rv\fR"
Print the window in reverse video
.IC "\fB\-scale \fIscale\fR"
Change the size of the window on the page
.IC "\fB\-slide\fR"
Print overhead transparencies on the PaintJet and PaintJet XL printers
.IC "\fB\-split \fIn\fR"
Split the window output over
.I n
pages
.IC "\fB\-top \fIinches\fR"
Set the top margin for the picture, in inches
.IC "\fB\-trailer \fIstring\fR"
Set a trailer string to be printed below the window
.IC "\fB\-width \fIinches\fR"
Set the maximum width of the page
.HE
The X client
.B xpr
formats and prints a dump of a window that had been generated by the client
.BR xwd .
It can format files for printing on PostScript printers,
the Digital LN03 or LA100, the IBM PP3812 page printer,
the Hewlett-Packard LaserJet (or other PCL printers), or the HP PaintJet.
.PP
By default,
.B xpr
prints the largest possible representation of the window on the output page.
By setting the appropriate command-line options,
you can add headers and trailers,
specify margins, adjust the scale and orientation,
and combine multiple window dumps to one output file.
.SH "Options"
.B xpr
recognizes the following command-line options:
.IP "\fB\-append \fIfilename\fR"
Append the output to
.IR filename .
This option does not apply to PostScript printers.
.IP "\fB\-compact\fR"
Use simple, run-length encoding for compact representation of windows
with lots of white pixels.
This is supported only on PostScript printers.
Note, too, that this option
compresses white space but not black space, so it is not useful for
reverse-video windows.
.IP "\fB\-cutoff \fIlevel\fR"
Change the level of intensity by which
.B xpr
maps colors to black or
white for monochrome output on a LaserJet printer.
.I level
gives the percentage of full brightness.
Fractions are allowed.
.IP "\fB\-density \fIdpi\fR"
Set to
.I dpi
the dot-per-inch density to be used by a Hewlett-Packard printer.
.IP "\fB\-device \fIdevtype\fR"
Print the output onto
.IR devtype ,
which must be one of the following:
.RS
.IP \fBla100\fR
The Digital LA100.
.IS \fBljet\fR
The Hewlett-Packard LaserJet series and other monochrome PCL devices,
such as ThinkJet, QuietJet, RuggedWriter, and Hewlett-Packard 12560- and
and 12930-series printers.
.IS \fBln03\fR
The Digital LN03.
.IS \fBlw\fR
The Apple LaserWriter.
This is equivalent to option
.BR pp .
.IS \fBpjet\fR
The Hewlett-Packard PaintJet (color mode).
.IS \fBpjetxl\fR
The Hewlett-Packard PaintJet XL Color Graphics Printer (color mode).
.IS \fBpp\fR
The IBM PP3812.
.IS \fBps\fR
Any PostScript printer.
.RE
.IP
The default is
.BR ps .
.IP "\fB\-gamma \fIcorrection\fR"
Change the intensity of the colors printed by PaintJet XL printer.
.I correction
is a floating-point value in the range 0.00 to 3.00.
Consult the operator's manual to determine the correct value for
the specific printer.
.IP "\fB\-gray 2|3|4\fR"
Uses a simple 2\(mu2, 3\(mu3, or 4\(mu4 gray-scale conversion on a color image,
rather than mapping to strictly black and white.
This doubles, triples, or quadruples the effective
width and height of the image.
This is not supported on IBM printers, or printers that run PCL.
.IP "\fB\-header \fIstring\fR"
Set a header string to be printed above the window.
.IP "\fB\-height \fIinches\fR"
Set the maximum height of the page.
.IP "\fB\-landscape\fR"
Print the window in landscape mode.
By default,
.B xpr
prints a window such that its longest side follows the long side of the paper.
.IP "\fB\-left \fIinches\fR"
Set the left margin, in inches.
Fractions are allowed.
By default, the window is centered in the page.
.IP "\fB\-noff\fR"
When specified with \fB\-append\fR,
this window appears on the same page as the previous window.
This option does not apply to PostScript printers.
.IP "\fB\-noposition\fR"
Bypass generation of commands for header, trailer, and image positioning
for LaserJet, PaintJet, and PaintJet XL printers.
.IP "\fB\-output \fIfilename\fR"
Write the output into
.IR filename .
If this option is not specified,
.B xpr
writes its output to the standard output.
.IP "\fB\-plane \fInumber\fR"
Set the bit plane to use in an image.
The default is to use the
entire image and map values into black-and-white, based on color intensities.
.IP "\fB\-portrait\fR"
Print the window in portrait mode.
By default, a window is printed such that its
longest side follows the long side of the paper.
.IP "\fB\-psfig\fR"
Suppress translation of the PostScript picture to the center of the page.
.IP "\fB\-render \fIalgorithm\fR"
Use
.I algorithm
to allow the Hewlett-Packard PaintJet XL printer to render the
image with the best ratio of quality versus performance.
Consult the operator's manual to determine which
.IR algorithm s
are available.
.IP "\fB\-rv\fR"
Print the window in reverse video.
.IP "\fB\-scale \fIscale\fR"
Change the size of the window on the page.
The PostScript, LN03, and Hewlett-Packard printers can
translate each bit in a window pixel map into a grid of a specified size.
For example, to translate each bit into a 3\(mu3 grid, use the option:
.DM
	\-scale 3
.DE
.IP
By default,
.B xpr
prints a window with the largest scale that will fit onto the page
for the specified orientation.
.IP "\fB\-slide\fR"
Print overhead transparencies on the PaintJet and PaintJet XL printers.
This is not supported on LaserJet printers.
.IP "\fB\-split \fIn\fR"
Split the window output over
.I n
pages.
This might be necessary for very large windows; otherwise,
cause the printer to overload and print the page in an obscure manner.
This is not supported for PCL or PostScript printers.
.IP "\fB\-top \fIinches\fR"
Set the top margin for the picture, in inches.
Fractions are allowed.
.IP "\fB\-trailer \fIstring\fR"
Set a trailer string to be printed below the window.
.IP "\fB\-width \fIinches\fR"
Set the maximum width of the page.
.SH "DEC Printers"
.II "LN03"
The current version of
.B xpr
can print on the LN03 most X Windows that are not larger
than two-thirds of the 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
.DM
	band too complex
.DE
.PP
and:
.DM
	page memory exceeded
.DE
.PP
In the case of the first error, 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 will flash the number
.B 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 occurs when 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 will automatically
split the picture into two or more pages.
It may flash the number
.B 5
on its from panel.
There is no easy solution to this problem.
It will probably be necessary to either cut and paste, or to rework the
application to produce a less complex picture.
.PP
There are several limitations on the LA100 support:
the picture is always printed in portrait mode,
there is no scaling, and the aspect ratio will be slightly off.
.SH "Hewlett-Packard Printers"
.II dpi
If the command line does not include the option
.BR \-density ,
.B xpr
uses 300 does per inch (dpi) for the LaserJet and 90 dpi for the Pjet.
Allowable values for the option
.B \-density
are 300, 150, 100, and 75 dpi.
Consult the operator's manual to determine densities
supported by other printers.
.PP
If the command line does not specify the option
.BR \-scale ,
.B xpr
expands the image to fit the printable page area.
.PP
The default printable page area is 8\(mu10.5 inches.
Other paper sizes can
be accommodated by using the command-line options
.B \-height
and
.BR \-width .
.PP
Note that a 1024\(mu768 image fits the default printable area when processed
at 100 dpi with
.B \-scale
set to one.
You can print the same image using 300 dpi with
.B \-scale
set to three, but this requires that considerably more data be sent to the
printer.
.PP
You can tailor
.B xpr
to drive monochrome PCL printers other than the LaserJet.
To print on a ThinkJet 12225A, invoke
.B xpr
with the following command:
.DM
	xpr -density 96 -width 6.667 \fIfilename\fP
.DE
.PP
Likewise, to print black-and-white output on a PaintJet, use the command:
.DM
	xpr -density 180 \fIfilename\fP
.DE
.PP
The monochrome intensity of a pixel is computed as
0.30\(muR + 0.59\(muG + 0.11\(muB.
If a pixel's computed intensity is less than the level set by the option
.BR \-cutoff ,
.B xpr
prints it as white.
This maps light-on-dark display images to black-on-white hard copy.
The default cutoff intensity is 50% of full brightness.
For example,
specifying
.B "\-cutoff 87.5"
moves the white/black intensity point to 87.5% of full brightness.
.PP
A LaserJet printer must be configured with sufficient memory to handle the
image.
A full page at 300 dots per inch requires approximately two megabytes
of printer memory.
.PP
.B xpr
produces color images on PaintJet at 90 dpi.
The PaintJet is limited to 16 colors from its 330-color palette on each
horizontal print line.
.B xpr
issues a warning message if it encounters more than 16 colors on a line.
.B xpr
programs the PaintJet for the first 16 colors it encounters
on each line, and uses the nearest matching programmed
value for other colors present on the line.
.PP
Specifying the reverse-video option
.B \-rv
for the PaintJet interchanges black and white on the output image.
No other colors are changed.
.PP
Multiplane images must have been recorded by
.B xwd
in
.B ZPixmap
format.
Single-plane (monochrome) images may be in either
.B XYPixmap
or
.B ZPixmap
formats.
.PP
Some PCL printers do not recognize image-positioning commands.
Output for these printers will not be centered on the page and header,
and trailer strings may not appear where expected.
.SH "Example"
.II xwd
Each image in this manual was captured from the screen by the X client
.BR xwd ,
then turned into an encapsulated PostScript file with the following command:
.DM
	xpr -portrait -psfig -scale 3 \fIfile\fP > \fIfile\fP.eps
.DE
.PP
where
.I file
names the file into which
.B xwd
had written its output.
.PP
The scaling factor was necessary to size the window correctly.
Note that a scaling factor of two was used with images of the root window
(such as the one that appears in the Lexicon entry for
.BR xsetroot );
otherwise, the image would not have fit into the format of this manual.
.PP
.II PostScript
.II "bounding box"
The PostScript output of
.B xpr
had to be edited slightly, to remove the instruction
.B showpage
at the bottom of the file.
Note, too, that the bounding-box comment at the beginning of the file was
extremely inaccurate; in some cases, the bounding box claimed that the image
had a negative width or height.
The only way to tell for certain is to print the image and measure it with
a pica rule.
.II troff
In this manual,
the final images are incorporated into the pages using custom-written
.B troff
macros.
.SH "See Also"
.B
X clients,
xwd,
xwud
.R
.SH Notes
Copyright \(co 1988, Massachusetts Institute of Technology.
Copyright \(co 1986, Marvin Solomon and the University of Wisconsin.
Copyright \(co 1988, Hewlett-Packard Company.
.PP
.II "Gretzinger, Michael R."
.II "Capo, Jose"
.II "Solomon, Marvin"
.II "Scheifler, Bob"
.II "Bock, Angela"
.II "Durbin, E. Mike"
.II "Rupp, Larry"
.B xpr
was written by
Michael R. Gretzinger and Jose Capo of MIT Project Athena,
Marvin Solomon of the University of Wisconsin,
Bob Scheifler of MIT,
Angela Bock and E. Mike Durbin of Rich Inc.,
and
Larry Rupp of Hewlett-Packard.
