pdfroff
Format troff documents into PDF
SYNOPSIS
pdfroff [options] [file...]
PARAMETERS
--title=TITLE
Sets the document title in the PDF metadata.
--author=AUTHOR
Sets the document author in the PDF metadata.
--subject=SUBJECT
Sets the document subject in the PDF metadata.
--keywords=KEYWORDS
Sets document keywords in the PDF metadata.
--url-color=COLOR
Sets the color for URL links within the PDF.
--link-color=COLOR
Sets the color for internal links (e.g., cross-references, table of contents) within the PDF.
-o pages
Outputs only the specified pages (e.g., 1-5,7).
-Z
Enables groff's safe mode, disabling certain unsafe commands that could read/write files or execute external programs.
-pS
Enables automatic PDF mark and link generation, crucial for clickable links and bookmarks (table of contents).
-m name
Appends the macro file name.tmac to the list of input files, often used for specific document styles.
-e
Preprocesses the input with eqn for handling mathematical equations.
-t
Preprocesses the input with tbl for handling tables.
--no-preprocessor
Disables automatic invocation of a specific preprocessor (e.g., --no-refer, --no-tbl).
DESCRIPTION
pdfroff is a wrapper script that processes groff input files and generates PDF output. It transparently invokes groff with the -Tpdf device, handling various preprocessors like refer, tbl, and eqn automatically. The command is designed to simplify the creation of PDF documents from roff source, providing built-in support for features such as table of contents generation, automatic page numbering, and PDF-specific metadata like titles and authors. It's a convenient tool for converting documentation written in roff markup into a widely viewable PDF format, ensuring proper handling of links and other PDF-specific features.
CAVEATS
pdfroff relies on the underlying groff and a PDF rendering backend (like ghostscript) being correctly installed and configured. Output quality and specific features might depend on the groff version and the configured PDF device. For highly complex layouts or interactive PDF features like form fields, direct use of other specialized PDF generation tools might be necessary.
AUTOMATIC PREPROCESSORS
pdfroff automatically invokes standard groff preprocessors like refer (for citations), tbl (for tables), eqn (for equations), pic (for pictures), grap (for graphs), grn (for gremlin pictures), chem (for chemical diagrams), and gcode (for code listings). This behavior simplifies the workflow but can be overridden using the --no-preprocessor options if specific preprocessors are not desired or cause issues.
PDF METADATA AND LINKS
The command allows setting various PDF metadata fields directly from the command line, such as title, author, subject, and keywords. This is particularly useful for document management, searchability, and accessibility. Furthermore, with the -pS option, pdfroff can generate clickable hyperlinks and bookmarks within the PDF document, significantly enhancing navigability. It also allows customizing the colors for URL and internal links.
HISTORY
pdfroff is part of the GNU roff (groff) typesetting system, which is a free software implementation of the classic roff text formatter. Groff was originally developed by James Clark. The -Tpdf device and subsequently pdfroff were added to groff to provide native PDF output capabilities. This evolution allowed users to generate modern, widely viewable PDF documents directly from roff source files, moving beyond earlier PostScript-centric workflows (like psroff) and simplifying document conversion.