psc or psdit Command

Purpose

Converts troff intermediate format to PostScript format.

Syntax

{ psc psdit } [  -f1 CodeSet:Font ] [  -FFontDirectory ] [ -MMediaName ] [ -pPrologue ] [  -oList ] [ File ]

Description

The psc and psdit commands translate a file created by device-independent troff to PostScript format for printing with a PostScript printer. If no file is specified, the standard input is used. The PostScript file is sent to the standard output.
Note: The input for the psc and psdit commands should be prepared with the corresponding -Tpsc option, such as the troff or pic command.

The psc and psdit commands can handle extended characters created by modifying the printer code field in the font file (/usr/lib/font/devpsc/R). The modified field contains a string surrounded by double quotation marks. The string contains a \b (backslash b) followed by a sequence of characters from the standard font that is composed into a new character by overstriking.

The psc and psdit commands allow users to cause the troff command to include arbitrary PostScript code in the generated PostScript file. The psc and psdit commands recognize the undefined % (percent) command in the troff intermediate file format to signal the start of raw PostScript code to be placed as is in the output file. Everything between (but not including) the % (percent sign) and a line containing a . (period) will be placed in the generated PostScript output.

This PostScript output is not insulated from the troff command coordinate system or the state of the generated PostScript output. However, two functions are defined in the prologue so that users can insulate themselves if so desired. The PB (picture begin) function performs a PostScript save operation, translates the PostScript coordinate system to troff's idea of the current position on the page, and changes the scale and orientation of the coordinate system axes to the standard PostScript 72 units per inch. The PE (picture end) macro ends this protected environment.

Several methods can be used to incorporate such included PostScript code into the troff intermediate file. For example, the .sy, \!, and .cf subcommands of the troff command use the following example to include the PostScript language description of a completely separate, printable document. In this example, the showpage operator is redefined to include mypic.ps as an illustration:

standard troff input
\&
.fl
\!%PB
\!/showpage{}def
.fl
.sy cat mypic.ps
\!PE
\!.
more standard troff input

Information containing various media sizes for the psdit command and the enscript command are contained in the file /usr/lib/ps/MediaSizes.

The information required for each entry in the MediaSizes file can be obtained from the PostScript Printer Description, or PPD, file that matches the PostScript printer used with TranScript. The PPD files are available from Adobe Systems Incorporated. The measurements extracted form the PPD files are in points. A printer's point is 1/72 of an inch.

Any line in the MediaSizes file beginning with an ASCII * (asterisk) is ignored when matching media size names provided on the command line to the enscript command and the psdit command.

Each entry in the MediaSizes file contains either eight or nine fields. The first eight fields are required for all entries. The ninth field is optional. Fields are separated by white space. The fields for each entry are as follows:

Field Name Description
EntryName Character string to match against a media name provided with the -M option with the enscript command or the psdit command.
MediaWidth Media width in points.
MediaDepth Media depth in points.
ImageableLLX Imageable lower left-hand corner x coordinate in points.
ImageableLLY Imageable lower left-hand corner y coordinate in points.
ImageableURX Imageable upper right-hand corner x coordinate in points.
ImageableURY Imageable upper right-hand corner y coordinate in points.
PageRegionName PostScript sequence for the particular printer to identify the size of the imageable area.
PaperTrayName PostScript sequence for the particular printer to select a particular paper/media tray. This field is optional.
Note: The sequence can be multiple PostScript operators or words for both the PageRegionName field and the PaperTrayName field. To specify such a sequence, use the ASCII " (double quotation mark character) to delimit the entire sequence.

The following are examples of field entries in the MediaSizes file:

Name Entries
Letter
Width
612
Depth
792
llx
18
lly
17
urx
597
ury
776
Page- Region- Name
Letter
Page- Tray- Name
Legal
Width
612
Depth
1008
llx
18
lly
17
urx
597
ury
992
Page- Region- Name
Legal
Page- Tray- Name

Flags

-f1 CodeSet:Font

Item Description
-FFontDirectory Takes font information from FontDirectory instead of the default.
-MMediaName Specifies a media name to use to determine the amount of imageable area on the paper. The name provided is matched against entries in the MediaSizes file. For instance, -M legal would request a legal size of paper as the imageable area. If this option is not used, the default size is letter size, which is 8.5 inches wide by 11.0 inches deep.
-pPrologue Uses the contents of Prologue instead of the default PostScript prologue.
-oList Prints pages whose numbers are given in the list separated by commas. The list contains single numbers and ranges in the format N1-N2, where N1 and N2 represent page numbers. A missing N1 means the range begins with the lowest-numbered page; a missing N2 means the range ends with the highest-numbered page.

Examples

The following statements are equivalent:

pic -Tpsc File | troff -Tpsc | psc

pic -Tpsc File | troff -Tpsc | psdit

Environment Variables

Item Description
PSLIBDIR Path name of a directory to use instead of the /usr/lib/ps file for the psc and psdit command prologue.
TRANSCRIPT Absolute path name of a file to use instead of /usr/lib/ps/transcript.conf for the MBCS handling.

Files

Item Description
/usr/lib/font/devpsc/* Contains the troff default description files for a PostScript virtual device.
/usr/lib/ps/psdit.pro Contains the default PostScript prologue.
/usr/lib/ps/MediaSizes Contains the default file used for media sizes.
/usr/lib/ps/transcript.conf Contains the default value used for PostScript codeset and font name.