GNU a2ps is an open source and completely free command-line software implemented in C++ and designed from the offset to help users easily convert various types of files to PostScript filters under any distribution of GNU/Linux.
Mainly supports Plain Text files
The program mainly supports Plain Text files, but it can also recognizes popular programming languages. Detailed documentation, updates, flashes, FAQ, mailing lists, etc. for GNU a2ps is available at http://www.inf.enst.fr/~demaille/a2ps.
Initially designed as a “Text to PostScript” conversion utility, the GNU a2ps program features pretty printing functionality, support for any file types (PostScript, compressed, Texinfo, etc.) if the necessary tools are installed.
Being a command-line app, the GNU a2ps program provides a wide range of command-line options, which can be viewed at a glance by running the ‘a2ps --help’ command in a terminal emulator software.
The command-line options are well-organized in sections, which include Tasks, Global, Sheets, Virtual pages, Headings, Input, Pretty-printing, Output, and PostScript. Various usage examples are also provided in the same output of the aforementioned command.
By default, the program does exactly what you want and bends to your needs, as it has been engineered to be extremely flexible and configurable through options. External applications can also be used for the processing of files.
Getting started with GNU a2ps
The GNU a2ps program can be found on the main software repositories of numerous important distributions of Linux, including Ubuntu, Arch Linux, Fedora or openSUSE, so it is quite easy to install it from there through the built-in graphical package manager.
After installation, you can interact with it via a Terminal app, by running the ‘a2ps < OPTIONS > < FILE >’ command, where the < FILE > tag is the file that needs to be converted and the < OPTIONS > tag is an option (see the section above for details).