psf
[
-1|2|4
] [
-b
n
] [
-c
n
] [
-f
n
] [
-g
type
] [
-h
]
[
-H
text
] [
-i
n
] [
-l
n
] [
-L
n
] [
-m
n
] [
-n
]
[
-p
n
] [
-t
n
] [
-w
] [
-x
]
file... >out.file
where -1|2|4 print 1,2 or 4 up on a page (default = 1)
-b n select paper bin n
-c n print columns (based on Courier font)
-d allow double sided printing
-f n font number/name (default = 0 = Courier)
-g type page type (default = letter)
-h put file name as header on each page
-H text put text as header on each page
-i n indent left margin n points
-l n print lines per page
-L n page length in lines
-m n indent top margin in points
-n set portrait (narrow) format
-p n set point size to n
-t n set tabs to n (default = 8)
-w set landscape (wide) format
-x draw cross with 4-up page
file.. name of files to be printed (or stdin)
Fonts selection with -f n (printer dependent)
0 Courier 1 Helvetica
2 Times-Roman 3 AvantGarde-Book
4 Bookman-Light 5 NewCenturySchlbk-Roman
6 Palatino-Roman 7 Helvetical-Narrow
8 Garamond 9 ZapfChancery-MediumItalic
Psf will accept text and filter it to print on postscript printers. The print may be "1-up", "2-up", or "4-up" on a page. Psf is a general purpose filter for most text and programme listings. By using various escape sequences (described below), any portion of the text may be printed in different fonts and at different point sizes.
If "letter" sized paper is used, the page is assumed to have 63 lines and 80 columns wide. For "legal" sized paper, the effective size is 81 lines by 80 columns. These dimensions account for the "print region" (excluding margins) of the page.
The actual number of print line and characters per line may be over-ridden by specifing suitable options.
General text may be printed with a command such as:
psf this.file that.fil | lp
Additional "pre-filters" such as pnf and pmf can be used to automatically generate escape sequences to control font and sizes for printed documents.
If an nroff'ed document is filtered with programme pnf , then the document will print properly with bold-face and underlining.
For example, you could print the psf man page "2-up" with:
nroff -man psf.1 | pnf -ir 3 | psf -2 | lp
Refer to the man-page for pnf/psnroff for greater detail.
Pmf is a very simple mail printing filter. It italicizes the contents of various headers such as 'Subject:' and attempts to place peoples names in boldface. It can be used to print entire mail boxes as in:
pmf /usr/spool/mail/tony | psf | lp
Refer to the man-page for pmf/psmbox for greater detail.
+-----------+-----------+ | pg 1 | pg 2 | | | | +-----------+-----------+
If four logical pages are specified with -4 , then the pages are printed in "portrait format:
+-----------+-----------+ | pg 1 | pg 3 | | | | +-----------+-----------+ | pg 2 | pg 4 | | | | +-----------+-----------+
Each logical page printed in 2-up or 4-up format contains the same number of lines and print columns as if it were printed in 1-up portrait format. The characters may be compressed or expanded horizontally to fill to the logical page width. For example, if you printed with:
psf -4 my.text | lp
then you would have four miniature pages, each of which would contain 63 print lines and 80 characters on a line.
If you wish to compensate for the character compression/expansion, then use the -c option to set the print line width.
Clipping is NOT performed in 2-up and 4-up printing. If the line lengths on the left half of the page exceed the logical page width, then the lines will overflow into the right half of the page.
If you specified -c40 , the character width would be horizontally elongated to twice normal.
If you specified -c160 , the character width would be compressed to one half normal width.
If the printer is configured with two print trays (such as a Nec LC890), then the double-sided printing is automatically performed. The operator re-inserts the printed "first side" stack of paper into the second tray. Printing then continues for the "second side".
If the printer is not configured with two trays, the output from psf must be directed to a file (not a pipe). This file must be processed with psd to print double sided. (Refer to the man page for psd. )
0 Courier 1 Helvetica 2 Times-Roman 3 AvantGarde-Book 4 Bookman-Light 5 NewCenturySchlbk-Roman 6 Palatino-Roman 7 Helvetica-Narrow 8 Garamond 9 ZapfChancery-MediumItalic
Your printer may not have exactly these fonts. To see which fonts are configured, get the psf usage information with:
psf -
Since Courier is the only fixed-pitch font, it is usually used for printing of man pages or programme listings. The other fonts are proportionally spaced.
The selected font becomes the new "default font".
The font may be specified either by the font number or the font name. For example, the Courier font could be selected with either option '-f 0' or '-f Courier'. If the selection is by name, then only a few of the characters of the name must be provided. The NewCenturySchlbk-Roman font could be selected with the option '-f New'.
type lines columns ------- ----- ------- letter 63 80 legal 81 80 a4 67 80 b5 58 65
The number of lines/columns represents the number of possible lines/columns in the printable region of the postscript printer - exclusive of the unprintable margin area.
The number of printed lines specified by -l may be less than the number of possible print lines specified by -L. For example, the default total number of print lines is 63 (as though you had specified -L63 ). If you used the option -l20 , then only the first 20 lines of the possible 63 would be printed. A skip to new page would be performed for the 21st line.
If you are printing text that is wider than the nominal 75-80 columns in width, then specify more than normal lines per page. Then number of print columns available will increase with the number of lines.
The number of lines specified by -L will be scaled to print between the top and bottom printable area of the page. Normally, the letter size page is 792 points high with 32 points unavailable for printing. Using 12 point letters, this results in a maximum of (792-32)/12=63.33 print lines (the 0.33 accounts for the lower case decenders and underline). If you specified more than 63 lines per page, then the page is appropriately scaled to print in smaller point sizes.
The number of lines specified by -L will be scaled to fit within the 760 available vertical points.
For example, if you specified -L31 , the number of lines on a page will set to 31 and the printed characters will be twice normal size. Conversely, if you specified -L126 , then the characters would be one half normal size.
The selected point size becomes the new "default point size".
The number of lines printed (by default) is the same as would be printed in portrait layout. Character point size is automatically scaled.
Psf filters text in a "minimally conforming" postscript format (as specified in the Postscript Language Reference Manual).
If the text contains escape sequences (possibly generated by pnf , another pre-filter or a text editor), the escape sequences are analyzed to perform limited font and underline selection. The escape sequences are translated into appropriate postscript code.
The permitted sequences have the following format:
^E<command>
The following sequences are recognized:
^EB begin bold (in current font family) ^Eb end bold ^EI begin italics ^Ei end italics ^EU begin underline ^Eu end underline. ^EFn begin font 'n' (0..8) ^Ef revert to default font ^EPnn begin point size 'nn' (2 digits) ^Ep revert to default point size ^E+ skip 1/2 line foreward ^E- skip 1/2 line backward "^E" is a true ctrl-E character, not the ascii text string "^", "E"
Note that point sizes with ^EPnn must be two digits such as ^EP07 or ^EP14.
Sequences may be nested: bold, italic, underlined would be generated with:
^EB^EI^EUbold, italic and underlined^Eu^Ei^Eb
The underline sequence should be 'innermost' to ensure that the underline follows the exact font width, correct thickness and position.
Font numbers are unique to a printer. Font 4 on one printer may not be the same as font 4 on a different printer. For a given printer, the font numbers are as specified on the usage menu of psf (generated with "psf --").
Any unrecognized escape sequences are ignored.
Any filter that can construct the above escape sequences may be used to provide input to psf. The provided pnf and pmf are only two simple examples.
If your text editor (such as vi) is able to conveniently insert a ^E character into text, the above sequences could be inserted and you would have "almost a word processor." This is a convenient way to add a bit of class to quick memos.
If psf has been installed as part of the Xenix or AT&T Unix 3.2 lp spooling system, then psf options may be passed in the lp command line using the -o option for lp :
lp -o"-4xh" this.file that.file --------
For AT&T Unix systems, the additional options of "banner" and "nobanner" may be passed to the spooler to print or not print a banner page:
lp -o"nobanner -4xh" this.file that.file or lp -o"banner -4xh" this.file that.file
pmf pnf psman psnroff psmbox lp lpadmin
Tony Field. tony@ajfcal