xpr(1X) xpr(1X)NAME xpr - prints an X window dump SYNOPSIS xpr [-device dev] [-scale scale] [-height inches] [-width inches] [-left inches] [-top inches] [-header string] [-trailer string] [-landscape] [-portrait] [-plane number] [-gray] [-rv] [-compact] [-output file] [-append file] [-noff] [-split number] [-psfig] [-density dpi] [-cutoff level] [- noposition] [-gamma correction] [-render algorithm] [-slide] [file] DESCRIPTION xpr takes as input a window dump file produced by xwd(1X)rand formats it for output on a PostScript printer, the Di-gital LN03 or LA100, the IBM PP3812 page printer, the HP LaserJet (or other PCL printers), or the HP PaintJet. If no file argument is given, the standard input is used. By de- fault, xpr prints the largest possible representation of the window on the output page. Options allow you to add headers and trailers, specify margins, adjust the scale and orienta- tion, and append multiple window dumps to a single output file. Output is to the standard output unless you specify the -output option. Options The xpr command accepts these options: -append file Specifies a filename previously produced by xpr to which the window is to be appended. -compact Uses simple run-length encoding for compact representation of windows with lots of white pixels. -cutoff level Changes the intensity level to which colors are mapped to black or white for monochrome output on the LaserJet printer. The level argument is ex- pressed as a percentage of brightness. Decimal fractions are allowed. -density dpi Indicates the dot-per-inch density for HP printers. -device device Specifies the device on which to print the file. The default device is ps. Use the following key- words to specify devices: November, 1990 1
xpr(1X) xpr(1X)la100 Specifies the Digital LA100 printer. ljet Specifies the HP LaserJet series and other monochrome PCL devices, such as ThinkJet, QuietJet, RuggedWriter, HP2560 series, and HP2930 series printers. ln03 Specifies the Digital LN03 printer. lw Specifies a PostScript printer and is equivalent to ps. This keyword is provided for downward compatibility. pjet Specifies the HP PaintJet printer in color mode. pjetxl Specifies the HP PaintJet XL color graphics printer in color mode. pp Specifies the IBM PP3812 printer. ps Specifies a PostScript printer. -gamma correction Changes the intensity of the colors printed by the PaintJet XL printer. The correction argument is a floating-point value in the range of 0.00-3.00. Con- sult the operator's manual to determine the correct value of the specific printer. -gray 2 | 3 | 4 Uses a simple 2 x 2, 3 x 3, or 4 x 4 gray-scale conversion on a color image rather than mapping strictly black and white. This doubles, triples, or quadruples the effective width and height of the im- age. -header header Specifies a header string to be printed above the window. 2 November, 1990
xpr(1X) xpr(1X)-height inches Specifies the maximum height of the window on the page. -landscape Forces the window to printed in landscape mode. By default, a window is printed so that its longest side follows the long side of the paper. -left inches Specifies the left margin in inches. Decimal frac- tions are allowed. By default, the window is cen- tered in the page. -noff When specified in conjunction with -append, causes the window to appear on the same page as the previ- ous window. -output file Specifies the name of an output file. If this op- tion is not specified, the standard output is used. -noposition Suppresses commands for generating a header and trailer and positioning the image for LaserJet, PaintJet, and PaintJet XL printers. -plane number Specifies which 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. -portrait Forces the window to be printed in portrait mode. By default, a window is printed so that its longest side follows the long side of the paper. -psfig Suppresses translation of the PostScript picture to the center of the page. -render algorithm Allows the PaintJet XL printer to render the image with the best quality-versus-performance tradeoff. Consult the operator's manual to determine an ap- propriate algorithm for your printer. -rv Forces the window to be printed in reverse video. -scale scale Affects the size of the window on the page. The PostScript, LN03, and HP printers are able to translate each bit in a window pixel map into a grid November, 1990 3
xpr(1X) xpr(1X)of a specified size. For example, each bit might translate into a 3 x 3 grid. This would be speci- fied by -scale 3. By default, a window is printed with the largest scale that fits on the page for the specified orientation. -slide Allows overhead transparencies to be printed using the PaintJet and PaintJet XL printers. -split number Splits a window among several pages. This option might be necessary for very large windows that would otherwise cause the printer to overload and print the page incorrectly. -top inches Specifies the top margin for the picture in inches. Decimal fractions are allowed. -trailer trailer Specifies a trailer string to be printed below the window. -width inches Specifies the maximum width of the window. HP printers If you do not specify -density on the command line, xpr uses 300 dots per inch for printers for which the -ljet option applies and 90 dots per inch for prints for which the -pjet option applies. Allowable -density values for the LaserJet printer are 300, 150, 100, and 75 dots per inch. For other HP printers, consult the operator's manual to determine the supported densities. If you do not specify -scale on the command line, xpr ex- pands the image to fit the printable page area. The default printable page area is 8 x 10.5 inches. Other paper sizes can be accommodated using the -height and -width options. Note that a 1024 x 768 image fits the default printable area when processed at 100 dots per inch with a scale of 1. The same image can also be printed using 300 dots per inch with a scale of 3, but requires considerably more data be transferred to the printer. You can tailor xpr for use with monochrome PCL printers oth- er than the LaserJet. To print on a ThinkJet (HP2225A), use xpr -density 96 -width 6.667 file 4 November, 1990
xpr(1X) xpr(1X)For black-and-white output to a PaintJet, use xpr -density 180 file The monochrome intensity of a pixel is computed as 0.30*R + 0.59*G + 0.11*B. If a pixel's computed intensity is less than the -cutoff level, the pixel is printed as white. This maps light-on-dark display images to black-on-white hard copy. The default cutoff intensity is 50% of full bright- ness. For example, specifying -cutoff 87.5 moves the white/black intensity point to 87.5% of full brightness. You must configure a LaserJet printer with sufficient memory to handle the image. You need approximately 2 megabytes of printer memory for a full page at 300 dots per inch. Color images are produced on the PaintJet at 90 dots per inch. The PaintJet is limited to 16 colors from its 330 color palette on each horizontal print line. The xpr com- mand programs the PaintJet for the first 16 colors encoun- tered on each line and uses the nearest matching programmed value for other colors present on the line. If xpr en- counters more than 16 colors on a line, it issues a warning message. If you specify the -rv (reverse video) option on the command line, xpr interchanges black and white on the output image when the printer is a PaintJet. No other colors are changed. You must record multiplane images by using xwd in ZPixmap format. You can record single plane (monochrome) images by using either XYPixmap or ZPixmap format. Some PCL printers do not recognize image-positioning com- mands. Output for these printers is not centered on the page, and header and trailer strings may not appear where expected. The -gamma and -render options are supported only on the PaintJet XL printers. The -slide option is not supported for LaserJet printers. The -split option is not supported for HP printers. LIMITATIONS On the LN03, xpr generally cannot print windows that are 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. November, 1990 5
xpr(1X) xpr(1X)The xpr command provides some support for the LA100. Howev- er, there are several limitations on its use: the picture is always printed in portrait mode, there is no scaling, and the aspect ratio is slightly off. Support for PostScript output cannot handle the -noff, -append, or -split options. The -compact option is only supported for PostScript output. It compresses white space but not black space, so it is not useful for reverse-video windows. For color images, xpr should map directly to PostScript im- age support. See ``HP Printers'' for additional limitations. DIAGNOSTICS A common error message is band too complex, which means that a window may have a particular 6-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 between two or more pages. Another common error message is page memory exceeded, which occurs if the picture contains too much black or complex halftones, 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 prob- lem. It will probably be necessary to cut and paste or re- work the application to produce a less complex picture. NOTES Copyright 1986, Marvin Solomon and the University of Wiscon- sin. Copyright 1988, Massachusetts Institute of Technology. Copyright 1988, Hewlett Packard Company. See X(1X) for a full statement of rights and permissions. Authors: Marvin Solomon, University of Wisconsin; Michael R. Gretzinger and Jose Capo, MIT Project Athena, for PP3812 support; Bob Scheifler, MIT; Angela Bock and E. Mike Durbin, Rich Inc. for grayscale support; Larry Rupp, Hewlett Packard, for printer support SEE ALSO X(1X), xdpr(1X), xwd(1X), xwud(1X) 6 November, 1990