LinuxCommandLibrary

roff2ps

Convert roff documents to PostScript

SYNOPSIS

roff2ps [options] [file ...]

PARAMETERS

-a
    Output all pages, even blank ones.

-b
    Output in black and white only (no color).

-c
    Specify the number of copies to print.

-d
    Set the output resolution in dots per inch (DPI).

-e
    Embed fonts in the PostScript output.

-h
    Set the page height.

-i
    Output in interlaced mode (for older printers).

-l
    Set the number of lines per page.

-m
    Select media size (e.g., letter, a4).

-n
    Output only the first pages.

-o
    Output only specific pages.
Ranges can be specified, example: 1-5,7,9.

-p
    Set the page orientation (portrait or landscape).

-q
    Suppress all warning messages.

-r
    Rotate the page by 90 degrees.

-s
    Set the paper size. Similar to -m, but may offer more specific sizing.

-t
    Use transparency.

-w
    Set the page width.

-z
    Do not compress the output.

DESCRIPTION

roff2ps is a command-line utility that converts roff (also known as troff) documents into PostScript format. Roff is a typesetting system, and roff2ps provides a means to render those documents in a universally supported printing format. It is commonly used to produce printable versions of man pages, technical documents, and other formatted text files. The command supports various options to control the output, including specifying paper size, orientation, font embedding, and other PostScript-specific settings.
It is often used as a component in larger document processing pipelines and provides a crucial bridge between roff's rich formatting capabilities and the need for portable, device-independent printing or viewing.
roff2ps is a part of the groff package.

CAVEATS

roff2ps requires a working groff installation. The output quality depends heavily on the quality of the input roff file and the fonts available on the system. Certain roff macros may not be fully supported. The PostScript generated might be large depending on the embedded fonts and image data.

USAGE EXAMPLES

Convert a roff file to PostScript:
roff2ps mydoc.roff > mydoc.ps

Convert a man page to PostScript:
man -t ls | roff2ps > ls.ps

Convert and Print only pages 1 to 5:
roff2ps -o 1-5 mydoc.roff > mydoc.ps

HISTORY

roff2ps has evolved alongside the groff typesetting system. It started as a utility to provide a PostScript output for roff documents, allowing for device-independent printing. Over time, it has been improved and extended to support various PostScript features and printer-specific options. It became an integral part of the GNU troff distribution (groff).

SEE ALSO

groff(1), troff(1), man(1)

Copied to clipboard