roff2ps
Convert roff documents to PostScript
SYNOPSIS
roff2ps [options] [file...]
PARAMETERS
-Fdir
Specifies an alternative font and device description directory to search before the standard paths. This influences how characters and graphics are rendered.
-s
Prints pages in portrait mode. This is often the default orientation.
-S
Prints pages in landscape mode, rotating the document by 90 degrees.
-c
Enables color output. This option applies if the input contains color commands and the PostScript device supports color.
-mname
Prepend name to the search path for device description files. This helps in finding specific configurations for output devices.
-p
Enables PostScript pre-scaling for a specific device resolution. Useful when the output needs to be precisely scaled for a target printer.
-r
Outputs pages in reverse order, starting from the last page to the first. Useful for printers that stack output face-down.
-R
Suppresses the generation of PostScript header comments, which can reduce file size slightly.
-ooutput-file
Directs the PostScript output to the specified output-file instead of the standard output (stdout).
-Tdevice
Specifies the output device. For roff2ps, this is typically 'ps' (PostScript). It determines the format of the output.
DESCRIPTION
roff2ps is a crucial utility within the groff (GNU roff) document formatting system. It acts as a filter, taking the intermediate output produced by troff or groff and translating it into PostScript.
This command is primarily used to render formatted text, tables, and graphics into a device-independent PostScript format, making documents suitable for printing on PostScript-compatible printers or for viewing with PostScript interpreters like Ghostscript. It accurately handles font metrics, character drawing, line graphics, and page management to preserve the original roff document's layout and appearance. Although often invoked indirectly by groff -Tps, roff2ps can also be used standalone by piping groff's intermediate output to it.
CAVEATS
roff2ps relies on a PostScript interpreter (like Ghostscript) or a PostScript-compatible printer for viewing and printing its output.
While highly capable, it might not perfectly render every obscure troff escape sequence or custom font without proper configuration and font availability on the target device. Complex documents can result in large PostScript files, potentially impacting processing time and storage.
COMMON USAGE
While roff2ps can be used standalone, it is most frequently invoked indirectly by the groff command itself. For example, groff -Tps document.roff > document.ps
implicitly uses roff2ps as the backend for PostScript generation. If used directly, it expects groff's intermediate output, not raw roff source:groff -Z document.roff | roff2ps > document.ps
.
INPUT AND OUTPUT
roff2ps accepts groff or troff's intermediate output format (often referred to as troff output stream) usually from standard input, or from specified files. Its primary output is device-independent PostScript code, typically directed to standard output or a specified file.
HISTORY
roff2ps is an integral component of the GNU groff project, which was developed as a free software alternative to the proprietary AT&T troff.
Its inception coincided with the rising popularity of PostScript as a standard page description language for printing. roff2ps was designed to provide a robust and flexible PostScript output driver for groff, enabling users to transform their meticulously formatted roff documents into print-ready PostScript files. It plays a pivotal role in bridging the powerful text processing capabilities of the roff system with modern printing technologies, continually evolving to support new PostScript features and groff enhancements.