Convert an ascii or a text file to postscript format for printing
atp [ -BCghlNoprRsvVW ] [ -c columns ] [ -t tabsize ] [ -f font ] [ -F headingsFont ] [ -cf commentsFont ] [ -title Title ] [ -date Date ] [ -M Tm,Bm,Lm,Rm [cm|in] ] [ -T papersize ] [ -wm string [font] ] [ -# copies ] [ -fonts ] [ -level1 ] [ -postscript ] [ file... ]
atp reads in text files and converts them to PostScript format. By default, it formats the output in two columns landscape mode in either an A4 or letter-size page, whichever was chosen by your system admin, with a 'fancy' header and using a 7 points Courier font. Fonts, paper sizes, headings and formatting options may be specified.
The PostScript output is by default directed to standard output; if the -o option is set the output is written in the file filename.ps. If no input file is given, the input is read from the standard input.
When working with C or C++ source files, as specified by the -C option, atp applies different styles to different areas of code: the comments are printed using a different font (Courier-BoldItalic, by default), the preprocessor instructions are italicized and the the function definitions headers are highlighted.
atp understands the nroff's bold and italic backspace conventions, and formats consequently his output.
Formfeed (control-L) characters in the input file causes a new page or column to be started.
PostScript files in input are transcribed on standard output, without translation, unless the -postscript option is set.
For example:
atp -Co source.c
writes a two columns landscape listing of the file source.c in the file source.c.ps, highlighting comments and function's headers.
atp -p file.txt | lpr
prints a copy of the file file.txt, in portrait mode, on the default printer used by lpr.
The fonts may be modified (scaled, rotated and sheared) by means of a transformation matrix. Font specifications have three parts:
-a font name, as known to PostScript (e.g.: Times-Roman, Courier-Bold) -a point size (1 point = 1/72 inch); a valid font size is any floating point value comprised between 5 and 50 points. -an (optional) transformation matrix, that consists of four floating point values, separated by a comma and preceded by a colon.
For example, valid font specifications are: Courier-Bold9:1,0,0.25,1 Helvetica10.5 AvantGarde-Demi7.34:1.75,0,-0.4,.8
A PostScript transformation Matrix is stored as a vector of 6 elements: [a b c d e f]
The matrix produces the transformation:
x' =
a x + c y + e y' = b x + d y + f
Since the translation of the font characters is no use, only the first four values must be specified, whereas e and f are kept to 0.
The default values of the matrix [a,b,c,d] are [1,0,0,1].
The widths of the characters is expanded if a>1 and reduced if a<1; the characters height is expanded if d>1 and reduced if d<1. Modifying the values of b and c causes a rotation of the font. Keeping b=0 and modifying c causes a font shearing.
Tabs in the input stream are expanded (by default) to eight character positions.
-o
Direct the output to file filename.ps
-p
Print the output in portrait mode (the default is the landscape mode).
-C
Assume that the input file is a C or a C++ source, recognizes and highlights the comments and the function definition's headers.
-c columns
Specify the number of the columns in which each page is subdivided.
-B
Turn off page headings.
-title Title
Print the text specified by Title as the title on each page, rather than the filename.
-date Date
Print the text specified by Date as the date on each page, rather than the current. Only the first 12 characters of Date are used.
-f font
Set the font to be used for the body of each page. The default is Courier7 in landscape mode, Courier10 in portrait mode, and Courier7:.83,0,0,1 if the -C option is set.
-F headingFont
Set the font to be used for the page headings. Defaults to Helvetica-Bold16.
-cf commentFont
Set the font to be used for emphasize the comments in a C source (when the -C option is specified). Defaults to Courier-BoldItalic7.
-M Tm,Bm,Lm,Rm [cm|in]
Set Top,Bottom,Left,Right margins. Their length is specified in points (1 point = 1/72 inch), unless the suffix cm or in are used.
-g
Disable the 'gaudy mode': don't paint the shaded frames in the headings.
-s
Turn off the shading of the headings
-T papersize
Set the output paper type as per the argument. The following paper sizes are recognized by atp: A3, A4, A5, B4, B5, Executive, Folio, Ledger, Legal, Letter, Quarto, Statement, Tabloid, 10x14.
-N
Precede each line with it's line number relative to the start of the file.
-t tabsize
Sets the number of columns to which tabs are expanded. The default is eight columns.
-h
Print usage message.
-v or -V
Display information identifying the version of atp. Nothing will be printed regardless of the other arguments.
-r or -R
Wrap the text on the space character preceding the right margin.
-W
Truncate lines which are wide for the page.
-l
Simulate a line printer: make pages 66 lines long and omit headers. (Useful to print manual pages).
-wm string [Font]
Print the watermark string on each page, using the font Font or Times-BoldItalic, by default.
-# copies
Print each page copies times.
-fonts
List the fonts recognized by atp.
-level1 (or -l1)
Generate a PostScript output suitable for a PostScript level 1 printer. With this option, the text file must contain only 7-bit characters. By default, atp recognizes 8-bit characters and produces a level 2 PostScript program.
-postscript
Do not pass through PostScript files.
If a font is specified that is not available on the printer, the result is undetermined.
No checking is performed on the input file to detect accidental printing of garbage files.
Paolo Severini - [email protected] (MSDOS support by Kenneth H. Carpenter - [email protected]; preprocessor papersize option and -date switch by Gabor J. Toth - [email protected])