Go to the first, previous, next, last section, table of contents.
This chapter documents the various shell scripts or other tools that are
distributed with the a2ps package, but are not a2ps itself. The
reader shoould also look at the documentation of Ogonkify
(see section `Overview' in Ogonkify manual), written by Juliusz
Chroboczek.
FIXME: Document me.
cardMany users of a2ps have asked for a reference card, presenting a summary of the options. In fact, something closely related to the output of `a2ps --help'.
The first version of this reference card was a PreScript file (see section 7.3.2 PreScript) to be printed by a2ps. Very soon a much better scheme was found: using a style sheet to pretty print directly the output of `a2ps --help'! A first advantage is then that the reference cards can be printed in the tongue you choose.
A second was that this treatment could be applied to any application supporting a `--help'-like option.
cardcard [options] applications
card is a shell script which tries to guess how to get your
applications' help message (typically by the options `--help'
or `-h'), and pretty prints it thanks to a2ps (or the content of
the environment variable `A2PS' if it is set).
Supported options are:
LC_ALL etc.
(such as `fr', `it' etc.).
If the applications don't support internationalization, English will be used.
card --command="cc -flags"
Any option that is not recognized by card is passed to
a2ps (see section 3.1 Command line options). Be aware that these options must
not be separated from their arguments. For instance
card gmake gtar --command="cc -flags" -Pdisplay
builds the reference card of GNU make, GNU tar
(automatic detection of `--help' support), and cc
thanks to `-flags'. Since `-P' is not supported
by card, it is passed to a2ps.
card
Remember that card runs the programs you give it, and the
commands you supplied. Hence if there is a silly programs that has a
weird behavior given the option `-h' etc., beware of the result.
It is even more clear using `--command': avoid running `card --command="rm -rf *"', because the result will be exactly what you think it will be!
fixps
The shell script fixps tries its best to fix common problems in
PostScript files that may prevent post processing. It makes heavy use
of the psutils. It is a good idea to use fixps upstream
in the PostScript to PostScript delegations.
fixps
fixps tries to make simple fixes, but some really broken files
may require much deeper treatment. If fixps feels the need for
such a major surgery act, it may give up local changes and ask
Ghostscript for a global rewriting.
fixps [options] [file]
sanitize the PostScript file (or of the standard input if no file is given, or if file is `-').
Supported options are:
ghoscript for a full rewrite of the file. The output
file is really sane, but can be much longer than the original. For this
reason and others, it is not always a good idea to make a full rewrite.
This option should be used only for files that give major problems.
fixnt
fixnt (see its
http://www.itsm.uni-stuttgart.de/~bauer/fixnt.html, home page) is
maintained by Holger Bauer and
Michael Rath. It is meant to fix
the problems of the PostScript files generated by the Microsoft
PostScript driver under Windows NT (3.5 and 4.0).
fixps is aware of the cases where fixnt should be used,
hence you should not worry of when to use fixnt.
fixntfixnt < `file.ps'
sanitize the PostScript file file.ps and produce the result on the standard output.
pdiff
The shell script pdiff aims to pretty print diff between files.
It basically uses GNU diff (see section `Overview' in Comparing and Merging Files) or GNU wdiff (see section `The word difference finder' in GNU wdiff) to extract the diff, then calls
a2ps with the correct settings to get a nice, printed contextual diff.
pdiffpdiff [options] file-1 file-2
make a pretty comparison between file-1 and file-2.
Supported options are:
Any option that is not recognized by pdiff is passed to a2ps
(see section 3 Invoking a2ps). Be aware that these options must not be
separated from their arguments. For instance
pdiff -l -Pdisplay COPYING COPYING.LIB
Compares the files `COPYING' and `COPYING.LIB', and prints it
on the printer display (usually Ghostview or gv).
Since `-P' is not supported by pdiff, it is passed to
a2ps.
psmandupI personally hate to print documents of hundreds of pages on a single sided printer. Too bad, here there are no Duplex printers. The idea is then simply first to print the odd pages, then the even in reversed order. To make sure one flips the page in the meanwhile, the second half should be printed from the manual feed tray.
Make a shell script that automates this, and you get psmandup.
psmanduppsmandup [options] [file]
produce a manual duplex version of the PostScript file (or of the standard input if no file is given, or if file is `-'). Once the first half is printed, put the sheet stack in the manual feed tray for the second half(5).
Be aware that there is a time out for manually fed jobs, usually short, hence do not miss the moment when the printer asks for the stack. If ever you missed that moment, see option `--back' to recover the second half.
Supported options are:
psmandup will fail on ill designed PostScript. Actually it is
the psutils that fail. To avoid this, by default the PostScript file is
sanitized by fixps.
When given this option, don't run fixps. This is meant to be
used when fixps has already been used higher in the processing
chain.
This option is especially useful when the manual feed time out expired before you could insert back the stack in the manual feed tray.
psmandup assumes the printer is Level 2, and supports manual
feeding. The file should be reasonably sane, otherwise
psmandup fails miserably.
Typical use is
psmandup file.ps | lp
or can be put into a2ps' printer commands (see section 4.5 Your Printers).
psset
The shell script psset inserts calls to setpagedevice in a
PostScript file. This is useful for instance to add Tumble or Manual
feed request. Actually, psmandup uses psset.
You should know nevertheless that a2ps is able to make the calls to
setpagedevice by itself, i.e., you can run `a2ps
-SManualFeed foo' to print `foo' onto the manually fed tray, or run
`a2ps -s2 foo' to print Duplex. There are no need of psset
from a2ps.
pssetpsset [options] [file]
produce a version of the PostScript file (or of the standard input
if no file is given, or if file is `-') that makes
protected calls to the PostScript operator setpagedevice. Typical
use is making file print duplex, or on the manual tray etc.
The call is protected so that the resulting file is safe, i.e., will still be portable, even with requests such as `-Sfoo:bar'.
It is safe to run psset with no feature requests. Depending upon
the option `--no-fix', it is either equivalent to doing nothing, or
to running fixps (see section 9.3 fixps).
Supported options are:
psset will fail on ill designed PostScript. Actually it is
the psutils that fail. To avoid this, by default the PostScript file is
sanitized by fixps.
When given this option, don't run fixps. This is meant to be
used when fixps has already been used higher in the processing
chain.
setpagedevice call setting key to value.
Multiple values accumulate. Lists of requests separated with `;'
are valid (e.g., `-SDuplex:true;Tumble:false').
setpagedevice call should be done.
The page 0, which is the default, corresponds to the beginning of
the `Setup' section in the document. In a typical use you should
not change the page.
Go to the first, previous, next, last section, table of contents.