psc or psdit Command
Purpose
Converts troff intermediate format to PostScript format.
Syntax
Description
The psc and psdit commands can
handle extended characters that are created by modifying the printer code field
in the font file (/usr/lib/font/devpsc/R). The modified field
contains a string that is 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 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 that is required for each entry in the
MediaSizes file can be obtained from the PostScript Printer
Description, or PPD
, file that matches the PostScript printer that
is used with TranScript. The PPD
files are available from Adobe Systems Incorporated.
The measurements that are extracted from 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 that is 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 or media tray. This field is optional. |
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 |
|
Legal |
|
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 that is 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 that 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 that is used for media sizes. |
/usr/lib/ps/transcript.conf | Contains the default value that is used for PostScript codeset and font name. |