Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

bitmap_to_file(3G)

bitmapfile(4G)

pcltrans(1G)

lp(1M)

screenpr(1G)

NAME

screenpr − capture the screen raster information and translate into PCL raster graphics format. 

SYNOPSIS

screenpr [ options ]

DESCRIPTION

The command screenpr captures screen raster data and translates the bitmap into Printer Command Language (PCL) raster graphics format.  By default, screenpr reads the frame buffeer associated with the device special file /dev/crt.  There is a command line option to specify an alternative device.  Since output is to standard out, screenpr should be used as a filter with output redirected to a file or to some other process such as the LP spooler. 

Output is a series of PCL commands which consist of binary data and escape sequences as described here.  (<esc> is the escape character, ASCII 0x027.)  The first command in the output is <esc>*t#R (to set graphics resolution), followed by <esc>*r1A (to start raster graphics).  Next follow individual rows of raster data prefixed with <esc>*b#W[raster data] (to transfer raster graphics).  The final command in the output is <esc>*rB (to terminate raster graphics).  Last of all, screenpr sends a form feed character. 

In addition, RGB pixels are converted to shades of gray based on their intensity values.  If pixels are not expanded, the output is left to right across the long dimension of the paper, and resolution is 300 dots per inch. 

When PCL imaging functionality is invoked (via the −C or −I option), the image is rendered using ordered dither and a gamma correction value of 0.8 (This is the default rendering algorithm.).  The output is from left to right across the long dimension of the paper. The −I option is used with printers having built-in imaging functionality. ("-I" option invokes the PCL imaging formatter.)  The −C option can be used with printers having built-in  imaging, or with printers that do not have built-in imaging.  (See the introduction and comparison sections of the Starbase Device Drivers Manual.) 

Warning: If a PCL file that contains imaging commands is sent to a PCL device that does not understand this functionality, the output will be incorrect. 

COMMAND LINE ARGUMENTS

Imaging Option:

−C Each pixel is converted to the appropriate output color value using an error diffusion algorithm. This option also changes the effect of the −c option.  Not all PCL printers support color mode.  The −a option overrides the default algorithm. 

−I The output image is scaled for the best fit on the size of media loaded in the device.  The data is left in RGB format and if the output device has color capabilities, the output is printed in color.  The output device will render the image at its highest possible resolution, and the output image is scaled for the best fit on whatever size media is loaded into the output device. 

Rendering Options:

−an Render algorithm desired.  Valid only in conjunction with the −C or −I option.  The possible values of n are:

0 = no algorithm applied
1 = snap to printer PRIMARIES (same as specifying −c and −C together)
2 = snap black to white and all other colors to black
    (can use for text screen dumps)
3 = color ordered dither (default)
4 = color error diffusion (same as the −C option)
5 = monochrome ordered dither
6 = monochrome error diffusion

−c Each pixel with a non-zero RGB value is converted to black.  Default is conversion to the nearest available shade of gray. 
This option has a different effect if the −C option is also specified.  In that case, each pixel is converted to the nearest PRIMARY color (red, green, blue, cyan, magenta, yellow, white, or black).  (The effects of specifying −c and −C together is the same as for the −a1 option.  Note: the −a option overrides this combination.) 

Positioning Options:

−R Output print orientation is left to right across the width of the paper (analogous to portrait mode on the LaserJet printer).  Default is left to right across the length of the paper (landscape mode).  Raster rotation is performed by screenpr rather than changing printer modes. 

−s Raster graphics is started at the current printer cursor position. 

−xinches
Destination image offset, x inches from the left boundary.  Valid only in conjunction with the −C or −I option. 

−yinches
Destination image offset, y inches from the top boundary.  Valid only in conjunction with the −C or −I option. 

Sizing Options:

−dinches
Width of the destination image in inches.  Valid only in conjunction with the −C or −I option. 

−eexp
Pixel expansion - indicates the expansion for each pixel in the bitmap and ranges from 1 to 8.  For example, to expand from a single pixel to a 4x4 cell, the expansion parameter is set to 4.  Default is 1.

−hinches
Height of the destination image in inches.  Valid only in conjunction with the −C or −I option. 

−llength
Length of the paper in inches. Not valid when −C or −I are also specified.  The default is 10.5 inches. 

−P The output image is scaled for the best fit on the size of media loaded in the device. Valid only in conjunction with the −C option. 

−rdots/inch
Printer resolution specified in dots per inch. This option is ignored when using the −C or −I option. 

−wwidth
Width of paper in inches. Not valid when −C or −I are also specified.  The default is 8.0 inches. 

Background/Foreground Options:

−bbcol
Background color table index for printing a single plane.  Default is 0. This option only has effect when printing a single plane as specified with the −p option. 

−ffcol
Foreground color table index for printing a single plane.  Default is 1. This option only has effect when printing a single plane as specified with the −p option. 

−k Don’t print the background color.  Default is to print the background color.  Use of the background_color_index call will cause unexpected results with this option. 

Image Reproduction Options:

−gvalue
Gamma correction value to apply to the image.  Accepted values may range between 0.0 and 2.0.  This is valid only in conjunction with the −C or −I option. 

−pplane
Bitmap plane to be printed when specifying a single plane to be printed. The default is to print a full-depth bitmap. If the plane specified in this option is a non-negative number and is not contained in the bitmap file, the formatter will exit with error. If the plane specified in this option is negative the formatter will default to all planes.

−q Presentation mode quality.  A higher quality available on the ink jet technology printers.  Valid only in conjunction with the −I option. 

−T Print on transparency film.  Valid only in conjunction with the −I option. 

−zopt
Scale algorithm to apply to the image, only if the destination image is smaller than the source in pixels.  Valid only in conjunction with the −C or −I option.  The possible values of opt are:

0 = algorithm to apply to an image with a light background
1 = algorithm to apply to an image with a dark background

Image Information:

−Dpixels
Width of the original image in pixels.  Default is the entire screen.

−Fdevfile
If the graphics monitor’s default is changed or multiple monitors are present, the user can specify the device file in which the bitmap is displayed. Default is /dev/crt. 

−Hpixels
Height of the original image in pixels.  Default is the entire screen.

−Xpixels
Offset of the source image from the screen’s left boundary.

−Ypixels
Offset of the source image from the screen’s top boundary.

RUN COMMANDS (rc) FILE

Screenpr will also accept options from a run commands file.  Before processing the command line arguments, screenpr looks for a run command file as follows:

1.  If there is a file in the current working directory named screenprrc, then read and process its contents. 

2.  Otherwise if there is a file in the user’s home directory named screenprrc, then read and process its contents. 

3.  Otherwise read and process the file /usr/lib/starbase/formatters/pcl/screenprrc, which comes with the Starbase product.  This file has reasonable defaults that should not alter screenpr’s behavior from previous releases. 

The rc file contents essentially have the same format as the command line options.  Each line of the rc file should be:

1.  Blank, or just spaces and tabs, or

2.  A comment, indicated by a ’#’ in the first column, or

3.  An option, with appropriate arguments, exactly as it would be given on the command line. 

Command line arguments override those specified in the rc file. 

NOTE: Command line options will not override certain option settings in the rc file: −I, −c, −C, −R, −s, −P, −k, −q, and −T. 

EXAMPLES

A typical case is formatting a file for output at 150 dots per inch resolution to a LaserJet Plus printer.  The desired plot orientation is left to right across the width of the page.  The output in this example is then piped to lp in raw mode so that no processing of the data is performed by lp. 

        screenpr -r150 -R | lp -oraw

Another typical example is to format a file to print with imaging capabilities invoked, color error diffusion, a gamma correction value of 0.6, and to obtain the bitmap from a device file /dev/other and pipe to the LP spooler. 

        screenpr -I -a4 -g0.6 -q -F/dev/other | lp -oraw

SEE ALSO

Starbase Reference: bitmap_to_file(3G), bitmapfile(4G), pcltrans(1G).  Starbase Graphics Techniques: "Storing, Retrieving, and Printing Images".  Starbase Device Drivers Manual: "PCL Formatter", "PCL Imaging Formatter".  HP-UX Reference: lp(1M). 

 

Hewlett-Packard Company  —  HP-UX Release 9.0: August 1992

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026