PowerAda a2ps

From OC Systems Wiki!
Jump to: navigation, search


a2ps - ASCII to PostScript converter with pretty-printing capabilities.




a2ps formats named ASCII files for printing in a PostScript printer; if no file is given, a2ps reads from the standard input. The output may be sent to a printer or to the standard output or saved into a file.

The format used is compact: normally two pages on each physical page, borders surrounding pages, headers with useful information (page number, printing date, file name or supplied header), line numbering, pretty-printing, symbol substitution etc. This is very useful for making archive listings of programs.


Mandatory arguments to long options are mandatory for short options too. Long options marked with * require a yes/no argument, corresponding short options stand for `yes'.

Options which Perform Tasks (exit successfully):

-V, --version
Display version.
Display this help.
Display Copyright and copying conditions.
Display guessed types of FILES.
Display a report on topic.
where topic can be any non-ambiguous abbreviation of
  • defaults: default settings and parameters,
  • features: short list of supported media, encodings, style sheets etc.
  • delegations, encodings, variables, media, ppd, printers, prologues,style-sheets, user-options: detailed list of the named items.


-q, --quiet, --silent.
Be really quiet.
-v, --verbose, --Verbose[=LEVEL]
Set verbosity on, or to LEVEL.
User-option=OPTION. Use the user defined shortcut OPTTION.
Enable debugging features.
Unset or set the macro K to the value V.


-M, --medium=NAME
Use output medium NAME.
-1, -2, ..., -9
Predefined layouts for 1, ..., 9 virtual pages.
Number of columns per sheet (NUM > 0).
Number of rows per sheet (NUM > 0).
First fill (DIRECTION=)rows, or columns.
-r landscape
Print in landscape mode.
-R, --portrait
Print in portrait mode.
-j, --borders*
Print borders around columns.
-A, --compact*
Allow two files on the same sheet.
Define an interior margin of size NUM.

Virtual pages:

Precede each NUM lines with its line number.
Alias for --line-numbers=5.
-f, --font-size=SIZE
Use font SIZE (float) for the body text.
-L, --lines-per-page=NUM
Specify how many lines are printed on each page.
-l, --chars-per-line=NUM
Specify how many columns are printed per page.
-m, --catman
Process the file as a man (same as -L66).
-T, --tabsize=NUM
Set tabulator size to NUM.
Specify how non-printable chars are printed.


-B, --no-header
No page headers at all.
-b, --header[=TEXT]
Set page header.
-u, --underlay[=TEXT]
Print TEXT under every page.
Set page title to TITLE.
Set left and right page title to TEXT.
Set sheet footers to TEXT.
TEXT may use special $ and % escapes


-a, --pages[=RANGE]
Select the pages to print.
-c, --truncate-lines*
Cut long lines.
-i, --interpret*
Interpret tab, bs and ff chars.
Specify the eol char (TYPE: r, n, nr, rn, any).
-X, --encoding=NAME
Use input encoding NAME.
-t, --title=NAME
Set the name of the job.
Set the name of the input file stdin.
Include FILE.pro as PostScript prologue.
Force binary printing.
-Z, --delegate*
Delegate files to another application.


-E, --pretty-print[=LANG]
Enable pretty-printing (set style to LANG).
Set pretty printing highlight LEVEL. LEVEL can be none, normal or heavy.
alias for --highlight-level=heavy.
Level of comments stripping


-o, --output=FILE
Leave output to file FILE. If FILE is `-', leave output to stdout.
Override the usual version control.
Override the usual backup suffix.
-P, --printer=NAME
Send output to printer NAME.
send output to the default printer.


Automatic PPD selection or set to KEY.
-n, --copies=NUM
Print NUM copies of each page.
-s, --sides=NUM
Number of sheet sides (recto/recto-verso).
-D, --setpagedevice=K[
Pass a page device definition to output.
-S, --statusdict=K[
Pass a statusdict definition to the output.
-k, --page-prefeed
Enable page prefeed.
-K, --no-page-prefeed
Disable page prefeed.


The following exit values are returned:

  • 0 terminated normally.
  • 1 an error occurred.
  • 2 bad argument was given.
  • 3 unknown language was given.


This must be defined and indicate the powerada/ada95 directory in the PowerAda installation.
Names a baselines file identifying aliases for baseline projects.


To print a file doc.txt, type:

 a2ps doc.txt

a2ps sends the file doc.txt to the default printer, writing two columns of text on a single face of the sheet. Indeed, by default a2ps does as if you had given the option `-2', standing for two virtual pages.

Say now that you want to print the C file bar.c, and its header foo.h, on 4 virtual pages, and save it into the file `foobar.ps'. Just type:

a2ps foo.h bar.c -4 -ofoobar.ps

The option `-4' tells a2ps to make four virtual pages: two rows by two columns. The option `-o' (which is the short version of `--output=foobar.ps') specifies the output file. The long options must always be separated by spaces, though short options with no arguments may be grouped. Note too that the options may be before or after the files, it does not matter


The full documentation for a2ps is maintained as a Texinfo manual. If the info and a2ps programs are properly installed at your site, the command info a2ps should allow you to access the manual as an hypertext.


Written by Akim.Demaille@inf.enst.fr and Miguel.Santana@st.com. News, updates and documentation, visit: http://www.inf.enst.fr/~demaille/a2ps/


Copyright c 1988, 89, 90, 91, 92, 93 Miguel Santana Copyright c 1995, 96, 97, 98 Akim Demaille, Miguel Santana This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.