LinuxCommandLibrary

pdfroff

Format troff documents into PDF

SYNOPSIS

pdfroff [options] [file ...]

PARAMETERS

-z
    Pass the -z option to ps2pdf for PDF compression.

-w word
    Pass word to groff.

-W word
    Pass word to ps2pdf.

-m name
    Process the named macro set after the default macros but before any included file.

-M dir
    Add dir to the macro path.

-f
    Force the use of ps2pdf even if groff -Tpdf would work.

-F
    Disable the use of groff -Tpdf. This is the opposite of -f.

-U
    Set the PDF 'UseAllSecurity' option to false when using Ghostscript.

-p string
    Set the PDF 'UserPassword' option to string when using Ghostscript.

-P string
    Set the PDF 'OwnerPassword' option to string when using Ghostscript.

-r string
    Set the PDF 'Permissions' option to string when using Ghostscript.

-e
    Pass the -e option to groff for pre-processing with eqn.

-t
    Pass the -t option to groff for pre-processing with tbl.

-g
    Pass the -g option to groff for pre-processing with grap.

-I
    Allow unsafe requests to groff.

-T dev
    Override the default device used by groff.

-S
    Allow unsafe requests to ps2pdf.

-d
    Enable debug output.

DESCRIPTION

The pdfroff command is a preprocessor and wrapper around groff designed to simplify the creation of PDF documents from troff source files. It automatically handles necessary steps such as running groff with appropriate options (like -Tps or -Tpdf depending on availability and configuration), and invoking ps2pdf or other PDF conversion tools if needed. It streamlines the process, allowing users to generate PDFs with minimal command-line options. It provides various options to control output options, input file formats, handling of included images, fonts, and security settings. The tool aims to make creating PDF documents from troff source files more accessible and convenient, avoiding complex command chains and ensuring consistent results.
It attempts to use groff directly to create a PDF document using -Tpdf. If that fails, it uses -Tps and ps2pdf to create a PDF document.

ENVIRONMENT VARIABLES

pdfroff uses various environment variables, including those affecting groff and ps2pdf. The most important variable is GROFF_TMAC_PATH which specifies the macro path.

USAGE EXAMPLE

To convert a file named mydocument.troff to PDF, simply run: pdfroff mydocument.troff. This will produce a file named mydocument.pdf. Use the -w option to pass custom parameters to groff: pdfroff -w '-Tps' mydocument.troff

SEE ALSO

groff(1), ps2pdf(1)

Copied to clipboard