PSF

Section: User Commands (1)
Updated:
Index Return to Main Contents
 

NAME

psf - postscript filter

 

SYNOPSIS

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

 

DESCRIPTION

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.

 

OPTIONS

-124
Specify the number of logical pages that are to be printed on a physical page. By default, psf will print one logical page per physical page. If two logical pages are specified with -2 , then two pages are printed in "landscape" format:

      +-----------+-----------+
      |   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.

-b n
Select paper bin n. If this option is not specified, the default paper bin is used. Psf assumes the paper bin number is valid for your printer.

-c n
Sets the number of print columns on a line. The character width is based on the Courier font (10 pitch, character width of 7.2 points). The text is scaled to print the desired number of characters over the entire page width. Setting the character count does NOT alter the number of print lines.

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.

-d
Prepare for double sided printing. The resulting print stream must be to a file which will subsequently filtered with psd.

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. )

-f n
Any of the standard postscript fonts may be selected in lieu of the default Courier. These are selected from the following table:
         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'.

-g type
Sets the working paper type. The type may be one of the following with the default number of lines and columns (assuming 12 point, 10 pitch characters):

        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.

-h
The file name, page number and current date will be printed at the top of each page. The point size is automatically scaled to permit the specified number of text lines to be printed to account for the additional two lines consumed by the title line.

-H text
Place a header (like -h ) however use text rather than the filename.

-i n
Indent the left margin by n points. This may be used to center the text in the page.

-l n
Sets the number of printed lines per page. The default is 63 lines for letter sized paper. If more than 63 lines per page are specified, the point size is automatically reduced to accomodate the line count.

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.

-L n
Specifies the number of lines available on the page. If -L is specified, then the page scale is adjusted to accomodate the line count. However, only the number of lines specified by the -l option will print.

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.

-m n
Move the top margin down by n points. This may be used to center the text in the page.

-n
The page is printed in portrait (narrow) format. This is the default for 1-up and 4-up printing. If 2-up printing is selected, the page is printed in landscape format. If portrait layout is desired for 2-up printing, then the -n option must be specified. Landscape printing requires the -w wide option to be used.

-p n
Sets the nominal point size to n points. This applies only to "1-up" printing. If "2-up" or "4-up" or "1-up, landscape" printing is desired, the nominal point size is automatically scaled.

The selected point size becomes the new "default point size".

-t n
Sets the width of the tab stops. By default this is set to 8. If the first line of a text file contains the string "ta=", then the tab stop width is automatically determined from this string. For example, if the first text line contains "/* ta=4 */" then the tab width is automatically set to 4. This feature is useful if programme source files use a tab space of 4.

-w
The page is printed in landscape (wide, horizontal format). This is the default for 2-up printing. If 1-up printing is desired in landscape mode, then the -w switch must be specified. Portrait printing requires that the -n (narrow) option be used.

The number of lines printed (by default) is the same as would be printed in portrait layout. Character point size is automatically scaled.

-x
Draws a cross in the to separate the logical pages. This is effective for 4-up printing. If 1-up or 2-up printing is used, this option is ignored.

 

PSF NOTES

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.

 

PRINTER SPOOLING

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

 

SEE ALSO

pmf pnf psman psnroff psmbox lp lpadmin

 

AUTHOR

Tony Field. tony@ajfcal


 

Index

NAME
SYNOPSIS
DESCRIPTION
OPTIONS
PSF NOTES
PRINTER SPOOLING
SEE ALSO
AUTHOR

This document was created by man2html, using the manual pages.
Time: 07:10:12 GMT, December 12, 2024