Appendix I. PostScript Interpreter (psrip) Command Line Options

As documented in Chapter 11, “Enhancing Impressario With Plug-Ins,” when you use an alternate PostScript Raster Image Processor (RIP) your new RIP must be command-line compatible with psrip. This appendix provides a listing of the psrip command line options.

The psrip command converts a PostScript file to raster data format By default, psrip assumes that its input will be arriving on the standard input, its output should be written to the standard output and error messages should be written to the standard error. If a filename is specified after all option switches, data will be read from that file rather than from the standard input.

The psrip command line options are as follows:

psrip [-O filename] [-L filename] [-P printer_name] [-F format] [-B bits] [-C colorspace] [-d device_type[arg1,[arg2]]] [-W width] [-H height] [-R res] [-X hres] [-Y vres] [-U hoff] [-V voff] [-I filename] [-G arg1,[arg2,[arg3,[arg4]]] [-T] [-j pixels] [-f] [-r angle] [-l] [-k] [-v] [-M] [-S] [-g scratch_dir] [-y persistent_dir] [-a startup_path] [-b backend_path] [-c resource_path] [-o backend_option] [-x] [-h] [-D[[D]D]] [PostScript input file]

-O filename  

Specifies the name of the file to which the rasterized output will be sent. If the -O option is not specified, output will be sent to the standard output.

-L filename  

Specifies the name of the file to which error, warning and informational messages are to be written. If the file specified already exists, any messages generated by psrip will be appended to the end of the file. If the -L option is not specified, message output will be sent to standard error.

-P printer_name 

Specifies the name of the printer for which raster output is to be generated. printer_name is the name of a printer that is physically attached to the system running psrip. The printer name is used to locate the Printer Object Database (POD) for the printer. If this option is specified, the printer specific values for output width, length, and resolution are filled in from the POD and need not be specified using command-line options. Use of the -P option is preferable to manually setting the options because changes to the printer configuration file will then be reflected in the program's output. The values read from the POD file can be selectively overridden using the command-line options. If POD values must be overridden, specify the overriding options after (to the right of) the -P option, since the rightmost option takes precedence.

For compatibility with previous releases of the Impressario product, the -P option can take a full pathname to the POD files instead of a printer name. psrip automatically detects that a complete pathname has been specified and looks for the POD files in the directory specified by that pathname. The use of full POD pathnames is discouraged.

-F format  

Specifies the output raster data format. format may be specified as chunky, or the default, planar. The data format is normally derived from the POD (see -P), which is kept up to date with the current printer configuration.

Chunky data is organized such that the color values for each dot appear together. For example, if a dot consists of three colors C, M and Y, chunky output format for a 3 dot by 3 dot image would be organized as:


Note that for the case of one bit per component, the chunky data above would contain a trailing 0 to nibble align each pixel's data (i.e. CMY0CMY0CMY0). Depths greater than one bit per component pack the data (i.e. CMYCMYCMY).

Planar data is organized such that all data for one color component is output followed by all data for the next color component and so on. For example, the CMY data in the above example organized for planar output would appear as:


The selection of output data organization for single component colorspaces is moot. Therefore, when the k or w colorspace is specified, the -F switch is ignored and by convention the output is considered to be in chunky format.

-B bits  

Specifies the number of bits per color component for the output data. Currently, bits may be specified as 1, the default, 4, or 8. The bits per color is normally derived from the POD (see -P), which is kept up to date with the current printer configuration.

-C colorspace  

Specifies the output data colorspace. The standard values of colorspace may be one of the following: k, the default, w (inverse k), cmy, cmyk, ymc, ymck, kcmy, or rgb. These values will all produce TIFF compatible output organized according to the -F option with a depth per color component specified by the -B option.

-Z compression  

Specifies the compression scheme to be used on the output data. Currently, compression is not supported.

-W width, -H height  

The -W and -H options specify the output data area in dots, in the horizontal (width) and vertical (height) directions, respectively. These values are normally derived from the POD (see -P), which is kept up to date with the currently loaded paper size. The default width and height correspond to an 8.5 by 11 inch output area rendered at 100 dots per inch (dpi). Therefore, the default output area is:

default width = 850 dots
default height = 1100 dots

-R res, -X hres, -Y vres  

The -R option specifies the printer resolution in dots per inch in the horizontal (width) and vertical (height) directions simultaneously. These values may be set independently using the -X (for width) and -Y (for height) options. These values are normally derived from the POD (see -P), which is kept up to date with the current printer configuration. The default horizontal and vertical resolutions are 100 dots per inch. There is no maximum resolution limitation.

-U hoff, -V voff 

These options specify the horizontal (x) and vertical (y) offsets of the frame buffer origin in dots, respectively. These options may be used to adjust the PostScript origin to compensate for image clipping and should be used with care. The default horizontal and vertical offsets are zero. Note that these offset are relative to the page and are not effected by image rotation or flipping.

-I filename  

It is often necessary to prepend PostScript code onto a PostScript file before it can be properly interpreted. Typically this prolog code consists of PostScript functions and definitions that will be referenced by the main PostScript file. Often the prolog is concatenated onto the beginning of the main file and the result is interpreted as a single file. The psrip program provides a more efficient means for prepending prolog files. The -I flag allows a prolog file to be included for processing before the main PostScript file. Multiple -I flags can be specified on the command-line. The files will be processed from left to right in the order specified.


At present this option performs no function in the level 2 rip. There is a default screen installed with the rip which can only be overridden by Postscript screen/halftone commands. It is not clear what purpose, if any, this option may perform in the future.

Since halftoning is a device dependent operation the default halftone may not produce adequate results on certain output devices. Under these circumstances it may be necessary to define a new PostScript halftone cell and prepend this definition to the input file as a PostScript prolog. Please refer to the “PostScript Language Reference Manual” for information on halftone cells. Refer to the -I switch for information on prolog files.

-G red_gamma,[green_gamma,[blue_gamma,[gray_gamma]]] 

Specifies gamma values that will be applied before the current job is executed. This option is realized via the Postscript setcolortransfer operator. The red_gamma is applied to the red/cyan color plane, the green_gamma is applied to the green/magenta color plane, the blue_gamma is applied to the blue/yellow color plane, and the gray_gamma to any black or gray color plane. The default value, no gamma correction (1.0), will be applied to any planes which are not specified via the command line. Please note that one must specify all the gamma values to specify a gray gamma value. Each gamma value is interpreted as a floating point number.


Specifies that the output image should be flipped (mirrored) about the vertical axis. This flag is useful when creating transparencies. Note that flipping of the image is performed after any rotation. Therefore, the image is always flipped about the vertical axis.

-r angle  

Specifies that the image is to be rotated by angle degrees. Positive rotations are counter-clockwise measured from the horizontal axis. The default rotation angle is 0. angle may be any positive or negative integer. Only angles which are a multiple of 90 degrees are supported. Specified angles that are not multiples of 90 degrees are snapped to the nearest multiple of 90 degrees.


Specifies that the output should be in landscape orientation rather than portrait. Note that specifying this option simply creates the raster imaging framebuffer with the page width and height values swapped. It is the responsibility of the PostScript input code to operate correctly in a landscape orientation. It may be necessary to specify an image rotation using the -r switch and a frame buffer offset using the -U and -V switches in order to obtain the desired landscape results.


The psrip program has two methods for allocating raster buffer storage. The back end DSO must define raster buffer allocation and deallocation functions that are used as callbacks by CPSI for raster buffer memory management. If the -M option is specified raster buffer allocation will be made by memory mapping a temporary disk file. This tends to improve performance when a large frame device is used (see the -d option). The -M option only takes effect when the device type is a frame device. The temporary file is created in the interpreter scratch file directory (see the -g option). The size of the temporary file will be equal to the amount of storage required for the raster buffer rounded up to the nearest memory page. For a frame device this can lead to a very large file. The temporary file is automatically removed by psrip.


A standard PostScript document will use a showpage operator between each page. The showpage operator instructs the interpreter to output the current raster image. Typically, Encapsulated PostScript files do not contain a showpage operator. The -S switch forces the execution of a showpage operator at the end of the PostScript file if a showpage has never been issued by the file. If the file has issued a showpage this switch has no effect. If a syntactically correct PostScript file does not produce an output image, the -S flag may be specified to force a single page output.

-d deviceType[,arg1[,arg2]] 

Specifies how raster image data should be fed from the interpreter kernel to the back end DSO. The available values of deviceType are described below. The default device type is auto. Note that certain values of deviceType accept optional arguments (i.e. arg1 and arg2).


Specifies that no raster image is to be produced. No raster buffer storage is allocated and the show, stroke, show page and copypage operators do nothing. However, all other aspects of interpreting the page description proceed normally. The best use of this option is to check a PostScript page description for syntactical or resource allocation errors, so called preflighting.


Specifies that a frame device should be used for imaging. A frame device allocates storage for a complete raster output page. The frame device was the only device type available in the Level 1 psrip.


Specifies that a band device be used. A band device renders the output raster image as a series of sequential bands and thus can use considerably less memory than a frame device. The back end is passed bands as they are rendered. The RIP can do a certain amount of parallel processing of bands and so the numBuffers option can specify the number of band buffers to be used. The default number of buffers is 1. The number of raster lines per band is determined by the memLimit option. This option specifies the total amount of memory that may be used for all band buffers. The default memory limit is 5 MBytes. memLimit is specified in number of bytes. Since the number of scan line in a band must be a power of two, the actual memory used for band buffers may differ from the specified memory limit.


Specifies that psrip should decide whether to use a frame device or a band device. This is the default device type. The decision is made based on the number of buffers to be used, numBuffers, and the memory use limit, memLimit. The RIP starts by assuming a frame device and calculates the amount of memory required. If the total amount of memory required exceeds memLimit, a band device is used. The band device is created with numBuffers bands and a total memory limit of memLimit. The default numBuffers is 1 and the default memLimit is 5 megabytes. The syntax for memLimit is the number of bytes. Since the number of scan lines in a band must be a power of two, the actual memory used for band buffers may differ from the specified memory limit. The 5 megabyte default memory limit was chosen because it is enough to render an 8.5 by 11 inch page with 1-bit per color CMYK at 300 dpi using a frame device.

-g scratchDir  

During execution the interpreter creates a scratch directory to place a number of temporary files. The directory and its contents are removed upon termination of psrip. The -g option specifies the directory in which the scratch directory is to be created. The directory specified with the -g option must exist and is not created (scratch directories within the specified directory are created). For example, if scratchDir is /usr/foodir then psrip will create the scratch directory /usr/foodir/uniqueDirName and place all temporary files in the /usr/foodir/uniqueDirName directory. The directory uniqueDirName and its contents will be removed by psrip upon termination. If the -g option is not specified, the default scratch file directory is created in one of two locations. If the environment variable PSRIPTMPDIR specifies a directory, the scratch directory will be created in that directory/uniqueDirName. If the variable is not set, the directory will be created in the /var/spool/lp/psparams/uniqueDirName directory. The uniqueDirName is created in all cases. This is necessary as all instances of the interpreter must have individual scratch areas.

-y persistentDir  

The interpreter kernel caches persistent configuration information in a number of disk files. The -y option can be used to specify an alternate persistent directory. The directory specified with the -y option must exist (psrip will not create it). Persistent information is used by the interpreter across invocations. For example, the total number of pages output by the RIP (the PageCount parameter) is maintained in a persistent file. By default persistent files are created by the interpreter in one of two directories. If a printer name has been specified (see -P option) and psrip is being run as the lp user (based on euid), the persistent files will be created in the directory /var/spool/lp/psparams/printerName. If a printer has not been specified or the user is not lp, the persistent files will be created in the scratch file directory (see -g option) and will be removed upon termination of the RIP. If the -y option is specified, persistent files will be placed in the directory persistentDir regardless of the user and regardless of whether a printer has been specified.

-a startupPath  

Specifies a search path for the directory containing the code and the POSTSCRIPT.VM initial VM file. The search path is a colon separated list of directories. The path is searched until each file is found. The default search path is /usr/lib/print/data/psrip. If startupPath contains a path consisting of the single character %, the default path will be substituted. For example, if startupPath is specified as %:/usr/people/foo the startup file search path will be /usr/lib/print/data/psrip:/usr/people/foo.

-b backendPath  

Specifies a search path for back end DSOs. All directories long the path are searched until the required DSO is found. A back end DSO is identified by a file ending in .so. The search path is a colon separated list of directories. The default search path is /usr/lib/print/psdevdso. If backendPath contains a path consisting of the single character %, the default path will be substituted. For example, if backendPath is specified as %:/usr/people/foo the back end DSO search path will be /usr/lib/print/ psdevdso:/usr/people/foo. If DSOs along the search path have the same name, the first DSO encountered will be used.

-c resourcePath  

Specifies a search path for interpreter resource files. All directories along the path are searched for files ending in .upr. The search path is a colon separated list of directories. The default search path is /usr/lib/print/data/psrip. If resourcePath contains a path consisting of the single character %, the default path will be substituted. For example, if resourcePath is specified as %:/usr/people/foo the resource file search path will be /usr/lib/print/data/psrip:/usr/people/foo. Printer-specific resource files can be read by adding their directory to resourcePath.

-o backendOptions 

This option is used to specify a string which will be passed to the backend active during processing. The contents of the backend option string is backend dependent. Basically, this establishes a method of communication between the psrip user and the backend.


Normally, psrip outputs the raster image with the PostScript origin on the trailing scan edge of the image. That is the origin is on the last raster line of the image. The -k option place the origin along the leading raster line. This option is equivalent to the option -r 180.


This option is used to color invert the output image. For example, inverting an rgb image results in the red, green and blue components replaced by cyan, magenta and yellow

-j pixels  

This option is used with xerographic engines. For a xerographic marking engine, laser light illuminates spots on a photosensitive medium that correspond to pixels of the raster image. Different technologies illuminate either the spots that correspond to colored pixels in the raster image - write-black engines - or else illuminate the spots that correspond to uncolored (white or blank) pixels in the raster image - write- white engines. This option is for use with write-white engines. The shapes of pixel marks on the medium are sufficiently different between write-black and write-white marking engines that special compensation must be made for the thinner shapes produced by write-white engines. The pixels argument specifies the number of pixels by which to fatten zero-width (one pixel) lines so that they do not break up on write- white marking engines. Specifying this option with a non-zero value of pixels also disables both the ATM font rasterizer and Type 1 hinting. Therefore, this option should only be used on write-white marking engines for which the rendering artifacts are quite pronounced and unsatisfactory.


Specifies that psrip should run in executive (i.e. interactive) mode. When run in this mode, the interpreter processes all startup code but ignores any input page description file. The interpreter accepts Post Script input at the PS> prompt. To exit the interpreter type CTRL-D or quit. In order to capture raster output the -O option must be specified. If -O is not specified all raster output is sent to stdout.


The -E switch, which provided backwards compatibility with the pschunky program, has been removed.


Prints a program usage message to the standard error. This usage message also lists the currently supported output configurations.


Specifies verbose output for debugging purposes. There are three levels of debugging information available.