XPR(1)
π NAME π
okay so this is xpr(1) from X Version 11, and it prints an X window dump. periodt. π
πΈ SYNOPSIS πΈ
Here's the whole invocation vibe, bestie:
xpr [-device devtype] [-scale scale]
[-height inches] [-width inches] [-left inches] [-top inches]
[-header string] [-trailer string] [-landscape] [-portrait]
[-plane number] [-gray] [-rv] [-compact]
[-output filename] [-append filename] [-noff] [-split n]
[-papertype format] [-pheight size [units]] [-pwidth size [units]]
[-psfig] [-density dpi] [-cutoff level] [-noposition]
[-gamma correction] [-render algorithm] [-slide] [filename]
xpr -help|-version
π¦ DESCRIPTION π¦
So xpr takes a window dump file made by xwd(1) and formats it for output on PostScript printers, the IBM PP3812 page printer, the HP LaserJet (or other PCL printers), or the HP PaintJet. If no file argument is given, standard input is used. By default, xpr prints the largest possible representation of the window on the output page. The options let you 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 π
okay bestie, here's the whole option menu β no skips, no summarizing, we're covering every single one. π«Ά
-device devtypeβ picks the device on which the file will be printed. Currently supported:ljetβ HP LaserJet series and other monochrome PCL devices such as ThinkJet, QuietJet, RuggedWriter, HP2560 series, and HP2930 series printerspjetβ HP PaintJet (color mode)pjetxlβ HP PaintJet XL Color Graphics Printer (color mode)ppβ IBM PP3812psβ PostScript printer
The default is PostScript. -device lw (LaserWriter) is equivalent to -device ps and is provided only for backwards compatibility.
-scale scaleβ affects the size of the window on the page. The PostScript and HP printers are able to translate each bit in a window pixel map into a grid of a specified size. For example each bit might translate into a3x3grid. 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. slay.-height inchesβ specifies the maximum height of the page.-width inchesβ specifies the maximum width of the page.-left inchesβ specifies the left margin in inches. Fractions are allowed. By default the window is centered in the page.-top inchesβ specifies the top margin for the picture in inches. Fractions are allowed.-header stringβ specifies a header string to be printed above the window.-trailer stringβ specifies a trailer string to be printed below the window.-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.-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. π-gray 2 | 3 | 4β uses a simple2x2,3x3, or4x4gray 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.-rvβ forces the window to be printed in reverse video.-compactβ uses simple run-length encoding for compact representation of windows with lots of white pixels.-output filenameβ specifies an output file name. If this option is not specified, standard output is used.-append filenameβ specifies a filename previously produced byxprto which the window is to be appended.-noffβ when specified in conjunction with-append, the window will appear on the same page as the previous window.-split nβ this option 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. dramatic but real.-papertype formatβ specifies the output paper format. Currently supported:letterβ letter size8.5x11 incheslegalβ legal size8.5x14 inchesA0β A0 size841x1189 mmor33.11x46.81 inchesA1β A1 size594x841 mmor23.39x33.11 inchesA2β A2 size420x594 mmor16.54x23.39 inchesA3β A3 size297x420 mmor11.69x16.54 inchesA4β A4 size210x297 mmor8.27x11.69 inchesA5β A5 size148x210 mmor5.83x 8.27 inchesA6β A6 size105x148 mmor4.13x 5.83 inchesA7β A7 size74x105 mmor2.91x 4.13 inchesA8β A8 size52x74 mmor2.05x 2.91 inchesA9β A9 size37x52 mmor1.46x 2.05 inchesA10β A10 size26x37 mmor1.02x 1.46 inchesB0β B0 size1000x1414 mmor39.37x55.67B1β B1 size707x1000 mmor27.83x39.37 inchesB2β B2 size500x707 mmor19.69x27.83 inchesB3β B3 size353x500 mmor13.90x19.69 inchesB4β B4 size250x353 mmor9.84x13.90 inchesB5β B5 size176x250 mmor6.93x 9.84 inchesB6β B6 size125x176 mmor4.92x 6.93 inchesB7β B7 size88x125 mmor3.46x 4.92 inchesB8β B8 size62x88 mmor2.44x 3.46 inchesB9β B9 size44x62 mmor1.73x 2.44 inchesB10β B10 size31x44 mmor1.22x 1.73 inchesC0β C0 size917x1297 mmor36.10x51.06 inchesC1β C1 size648x917 mmor25.51x36.10 inchesC2β C2 size458x648 mmor18.03x25.51 inchesC3β C3 size324x458 mmor12.76x18.03 inchesC4β C4 size229x324 mmor9.02x12.76 inchesC5β C5 size162x229 mmor6.38x 9.02 inchesC6β C6 size114x162 mmor4.49x 6.38 inchesC7β C7 size81x114 mmor3.19x 4.49 inchesC8β C8 size57x81 mmor2.24x 3.19 inchesC9β C9 size40x57 mmor1.57x 2.24 inchesC10β C10 size28x40 mmor1.10x 1.57 inches
-pheight size [ units ]β lets you specify a specific paper height. The default units are in inches (in), but may be overridden withcmormmfor centimeters or millimeters respectively.-pwidth size [ units ]β lets you specify a specific paper width, but may be overridden withcmormmfor centimeters or millimeters respectively.-psfigβ suppresses translation of the PostScript picture to the center of the page.-density dpiβ indicates what dot-per-inch density should be used by the HP printer.-cutoff levelβ changes the intensity level where colors are mapped to either black or white for monochrome output on a LaserJet printer. The level is expressed as percentage of full brightness. Fractions are allowed.-nopositionβ causes header, trailer, and image positioning command generation to be bypassed for LaserJet, PaintJet and PaintJet XL printers.-gamma correctionβ changes the intensity of the colors printed by a PaintJet XL printer. The correction is a floating point value in the range0.00to3.00. Consult the operator's manual to determine the correct value for the specific printer.-render algorithmβ allows a PaintJet XL printer to render the image with the best quality versus performance tradeoff. Consult the operator's manual to determine which algorithms are available.-slideβ allows overhead transparencies to be printed using the PaintJet and PaintJet XL printers.-helpβ prints the program usage information and exits.-versionβ prints the program version information and exits.
π SEE ALSO π
π LIMITATIONS π
- Support for PostScript output currently cannot handle the
-append,-noff, or-splitoptions. so don't try it, bestie. - The
-compactoption 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, it should map directly to PostScript image support.
π HP PRINTERS π
Okay bestie, printer time β this part is all about HP hardware and the little details that matter. If you donβt pass -density on the command line, xpr assumes 300 dots per inch for ljet and 90 dots per inch for pjet. The allowable density values for a LaserJet printer are 300, 150, 100, and 75 dots per inch. For other printers? Consult the operatorβs manual to figure out which densities they support, fr fr.
If no -scale is specified, the image gets expanded to fit the printable page area. The default printable page area is 8x10.5 inches. Other paper sizes can be accommodated using the -papertype option or the -height and -width options.
Cute size note: a 1024x768 image fits the default printable area when processed at 100 dpi with scale=1. The same image can also be printed using 300 dpi with scale=3, but that will require considerably more data be transferred to the printer. π
xpr may be tailored for use with monochrome PCL printers other than the LaserJet. To print on a ThinkJet (HP2225A), xpr could be invoked as:
xpr -density 96 -width 6.667 filename
or for black-and-white output to a PaintJet:
xpr -density 180 filename
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, it will print as white. This maps light-on-dark display images to black-on-white hardcopy. The default cutoff intensity is 50% of full brightness. Example: specifying -cutoff 87.5 moves the white/black intensity point to 87.5% of full brightness. β¨
A LaserJet printer must be configured with sufficient memory to handle the image. For a full page at 300 dots per inch, approximately 2MB of printer memory is required. No skipping the memory check, bestie.
Color images are produced on the PaintJet at 90 dots per inch. The PaintJet is limited to sixteen colors from its 330 color palette on each horizontal print line. xpr will issue a warning message if more than sixteen colors are encountered on a line. xpr will program the PaintJet for the first sixteen colors encountered on each line and use the nearest matching programmed value for other colors present on the line.
Specifying the -rv, reverse video, option for the PaintJet will cause black and white to be interchanged on the output image. No other colors are changed. Periodt.
Multiplane images must be recorded by xwd in ZPixmap format. Single plane (monochrome) images may be in either XYPixmap or ZPixmap format.
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.
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.
The -gray option is not supported for HP or IBM printers.
π«Ά AUTHORS π«Ά
These are the icons who made it happen:
- Michael R. Gretzinger, MIT Project Athena
- Jose Capo, MIT Project Athena (
PP3812 support) - Marvin Solomon, University of Wisconsin
- Bob Scheifler, MIT
- Angela Bock and E. Mike Durbin, Rich Inc. (grayscale)
- Larry Rupp, HP (HP printer support)
- Jay Hobson, Sun Microsystems (papertype support)
Thatβs the whole page, bestie π This oneβs from xpr 1.2.1, dated 2025-04-06, and itβs the XPR(1) manual β go print something iconic β¨
π¦ where this page comes from
- arch rolling: xorg-xpr 1.2.1-1 Β· MIT
- nixpkgs unstable: xpr 1.2.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms