pdfroff(1)
π β¨ pdfroff(1) β General Commands Manual β¨π
okay bestie, welcome to the pdfroff manual page. This is the part where we make Portable Document Format files with groff, and I'm gonna walk you through every single flag like we're ranking them in the group chat. ππ¦
πΈ NAME πΈ
pdfroff β construct files in Portable Document Format using groff
periodt. π
β¨ SYNOPSIS β¨
pdfroff [groff-option] [--emit-ps] [--no-toc-relocation]
[--no-kill-null-pages] [--stylesheet=name] [--no-pdf-output]
[--pdf-output=name] [--no-reference-dictionary]
[--reference-dictionary=name] [--report-progress]
[--keep-temporary-files] [file ...]
pdfroff -h
pdfroff --help
pdfroff -v [groff-option ...]
pdfroff --version [groff-option ...]
so groff-option is any short option supported by groff(1) except for -h, -T, and -v; see section βUsageβ below. π
π DESCRIPTION π
okay so pdfroff is a wrapper program for the GNU text processing system, groff. It transparently handles the mechanics of multiple pass groff processing, when applied to suitably marked up groff source files, such that tables of contents and body text are formatted separately, and are subsequently combined in the correct order, for final publication as a single PDF document. A further optional βstyle sheetβ capability is provided; this allows for the definition of content which is required to precede the table of contents, in the published document. π¦
For each invocation of pdfroff, the ultimate groff output stream is post-processed by the Ghostscript gs(1) interpreter to produce a finished PDF document. β¨
pdfroff makes no assumptions about, and imposes no restrictions on, the use of any groff macro packages which the user may choose to employ, in order to achieve a desired document format; however, it does include specific built in support for the pdfmark macro package, should the user choose to employ it. Specifically, if the pdfhref macro, defined in the pdfmark.tmac package, is used to define public reference marks, or dynamic links to such reference marks, then pdfroff performs as many preformatting groff passes as required, up to a maximum limit of four, in order to compile a document reference dictionary, to resolve references, and to expand the dynamically defined content of links. π
π USAGE π
The command line is parsed in accordance with normal GNU conventions, but with one exceptionβwhen specifying any short form option (i.e., a single character option introduced by a single hyphen), and if that option expects an argument, then it must be specified independently (i.e., it may not be appended to any group of other single character short form options). π
Long form option names (i.e., those introduced by a double hyphen) may be abbreviated to their minimum length unambiguous initial substring. β¨
Otherwise, pdfroff usage closely mirrors that of groff itself. Indeed, with the exception of the -h, -v, and -T dev short form options, and all long form options, which are parsed internally by pdfroff, all options and file name arguments specified on the command line are passed on to groff, to control the formatting of the PDF document. Consequently, pdfroff accepts all options and arguments, as specified in groff(1), which may also be considered as the definitive reference for all standard pdfroff options and argument usage. π«Ά
π OPTIONS π
okay bestie, pdfroff accepts all of the short form options (i.e., those introduced by a single hyphen), which are available with groff itself. In most cases, these are simply passed transparently to groff; the following, however, are handled specially by pdfroff. π₯
-hβ Same as--help; see below. π-iβ Process standard input, after all other specified input files. This is passed transparently togroff, but, if grouped with other options, it must be the first in the group. Hiding it within a group breaks standard input processing, in the multiple-passgroffprocessing context ofpdfroff. π-T devβ Only-T psis supported bypdfroff. Attempting to specify any other device causespdfroffto abort. π-vβ Same as--version; see below. β
See groff(1) for a description of all other short form options, which are transparently passed through pdfroff to groff. π
All long form options (i.e., those introduced by a double hyphen) are interpreted locally by pdfroff; they are not passed on to groff, unless otherwise stated below. π
--helpβ Causespdfroffto display a summary of the its usage syntax, and supported options, and then exit. π--emit-psβ Suppresses the final output conversion step, causingpdfroffto emit PostScript output instead of PDF. This may be useful to capture intermediate PostScript output when using a specialised postprocessor, such asgpresentfor example, in place of the default Ghostscript PDF writer. π¦--keep-temporary-filesβ Suppresses the deletion of temporary files, which normally occurs afterpdfroffhas completed PDF document formatting; this may be useful when debugging formatting problems. π΅οΈ
See section βFilesβ below for a description of the temporary files used by pdfroff. π
--no-pdf-outputβ May be used with the--reference-dictionary=nameoption (described below) to eliminate the overhead of PDF formatting when runningpdfroffto create a reference dictionary for use in a different document. β¨--no-reference-dictionaryβ May be used to eliminate the overhead of creating a reference dictionary, when it is known that the target PDF document contains no public references, created by thepdfhrefmacro. π--no-toc-relocationβ May be used to eliminate the extragroffprocessing pass, which is required to generate a table of contents, and relocate it to the start of the PDF document, when processing any document which lacks an automatically generated table of contents. π--no-kill-null-pagesβ While preparing for simulation of the manual collation step, which is traditionally required to relocate a table of contents to the start of a document,pdfroffaccumulates a number of empty page descriptions into the intermediate PostScript output stream. During the final collation step, these empty pages are normally discarded from the finished document; this option forcespdfroffto leave them in place. π--pdf-output=nameβ Specifies the name to be used for the resultant PDF document; if unspecified, the PDF output is written to standard output. A future version ofpdfroffmay use this option, to encode the document name in a generated reference dictionary. π--reference-dictionary=nameβ Specifies the name to be used for the generated reference dictionary file; if unspecified, the reference dictionary is created in a temporary file, which is deleted whenpdfroffcompletes processing of the current document. This option must be specified, if it is desired to save the reference dictionary, for use in references placed in other PDF documents. π«Ά--report-progressβ Causespdfroffto display an informational message on standard error, at the start of eachgroffprocessing pass. π£--stylesheet=nameβ Specifies the name of an input file, to be used as a style sheet for formatting of content, which is to be placed before the table of contents, in the formatted PDF document. π--versionβ Causespdfroffto display a version identification message. The entire command line is then passed transparently togroff, in a one pass operation only, in order to display the associatedgroffversion information, before exiting. π
π ENVIRONMENT π
okay bestie, these are the env vars you can set and export to change how pdfroff behaves. each one is a lil vibe knob β¨
PDFROFF_COLLATEβ tellspdfroffwhich program to use for collating the finished PDF document. π
this collation step is sometimes needed to scoot tables of contents to the start of the finished PDF, since traditional macro packages print them at the end instead. but ngl, you should not normally need to set PDFROFF_COLLATE β and fr fr, you're not encouraged to. if it's unspecified, pdfroff uses sed(1) by default, and that normally suffices.
if you do set PDFROFF_COLLATE, it has to act as a filter: it accepts a list of file name arguments and writes its output to the standard output stream, from where it's piped to the PDFROFF_POSTPROCESSOR_COMMAND to make the finished PDF output.
when you specify PDFROFF_COLLATE, you'll normally also need to specify PDFROFF_KILL_NULL_PAGES.
heads up:PDFROFF_COLLATEgets ignored ifpdfroffis invoked with the--no-kill-null-pagesoption.
PDFROFF_KILL_NULL_PAGESβ specifies options to be passed to thePDFROFF_COLLATEprogram.
it should not normally be necessary to specify this one either. the internal default is a sed(1) script meant to remove completely blank pages from the collated output stream, and it should be appropriate for most applications of pdfroff. but if you swap in any alternative to sed(1) for PDFROFF_COLLATE, then you'll likely need a matching alternative for PDFROFF_KILL_NULL_PAGES. π«Ά
same as PDFROFF_COLLATE: PDFROFF_KILL_NULL_PAGES is ignored if pdfroff is invoked with the --no-kill-null-pages option.
PDFROFF_POSTPROCESSOR_COMMANDβ specifies the command used for the final document conversion from PostScript intermediate output to PDF. it must behave as a filter, writing its output to the standard output stream, and it must accept an arbitrary number of files ... arguments, with the special case of-representing the standard input stream.
if unspecified, PDFROFF_POSTPROCESSOR_COMMAND defaults to:
gs -dBATCH -dQUIET -dNOPAUSE -dSAFER -sDEVICE=pdfwrite \
-sOutputFile=-
GROFF_TMPDIRβ identifies the directory wherepdfroffshould create temporary files. ifGROFF_TMPDIRisn't specified, thenTMPDIR,TMPandTEMPget considered in turn as possible temporary file repositories. if none of those are set, temporary files get created in the current directory. πGROFF_GHOSTSCRIPT_INTERPRETERβ specifies the program invoked whenpdfroffconverts groff PostScript output to PDF. ifPDFROFF_POSTPROCESSOR_COMMANDis specified, then the command name it gives is implicitly assigned toGROFF_GHOSTSCRIPT_INTERPRETER, overriding any explicit setting from the environment. ifGROFF_GHOSTSCRIPT_INTERPRETERis not specified, thenpdfroffsearches the processPATHlooking for a program with any of the well known names for the Ghostscript interpreter; and if no Ghostscript interpreter can be found,pdfroffaborts. πGROFF_AWK_INTERPRETERβ specifies the program invoked whenpdfroffis extracting reference dictionary entries from a groff intermediate message stream. ifGROFF_AWK_INTERPRETERisn't specified,pdfroffsearches the processPATHlooking for any of the preferred programs,gawk,mawk,nawk, andawk, in that order; if none of those are found,pdfroffissues a warning message and continues processing β but in that case, no reference dictionary is created. πOSTYPEβ typically defined automatically by the operating system.OSTYPEis used on Microsoft Win32/MS-DOS platforms only, to infer the defaultPATH_SEPARATORcharacter, which is used when parsing the processPATHto search for external helper programs.PATH_SEPARATORβ if set,PATH_SEPARATORoverrides the default separator character (:on POSIX/Unix systems, inferred fromOSTYPEon Microsoft Win32/MS-DOS), which is used when parsing the processPATHto search for external helper programs.SHOW_PROGRESSβ if this is set to a non-empty value, thenpdfroffalways behaves as if the--report-progressoption is specified on the command line. π
π FILES π
input and output files for pdfroff may be named according to any convention of the user's choice. typically, input files may be named according to the choice of the principal formatting macro package, e.g., file.ms might be an input file for formatting using the ms macros (s.tmac); normally, the final output file should be named file.pdf. π
temporary files created by pdfroff are placed in the file system hierarchy, in or below the directory specified by environment variables (see the section βEnvironmentβ above). if mktemp(1) is available, it is invoked to create a private subdirectory of the nominated temporary files directory, with subdirectory name derived from the template pdfroff-XXXXXXXXXX; if that subdirectory is successfully created, the temporary files go inside it β otherwise they go directly in the directory nominated in the environment.
all temporary files themselves are named according to the convention pdf$$.*, where $$ is the standard shell variable representing the process identifier of the pdfroff process itself, and * represents any of the extensions pdfroff uses to identify the following temporary and intermediate files. πΈ
pdf$$.tmpβ a scratch pad file, used to capture reference data emitted by groff, during the reference dictionary compilation phase.pdf$$.refβ the reference dictionary, as compiled in the last but one pass of the reference dictionary compilation phase; (at the start of the first pass, this file is created empty; in successive passes, it contains the reference dictionary entries, as collected in the preceding pass).
if the --reference-dictionary=name option is specified, this intermediate file becomes permanent, and is named name, rather than pdf$$.ref.
pdf$$.cmpβ used to collect reference dictionary entries during the active pass of the reference dictionary compilation phase. at the end of any pass, when the content ofpdf$$.cmpcompares as identical topdf$$.ref(or the corresponding file named by the--reference-dictionary=nameoption), then reference dictionary compilation is terminated, and the document reference map is appended to this intermediate file, for inclusion in the final formatting passes.pdf$$.tcβ an intermediate PostScript file, in which βTable of Contentsβ entries are collected, to facilitate relocation before the body text, on ultimate output to the Ghostscript postprocessor.pdf$$.psβ an intermediate PostScript file, in which the body text is collected prior to ultimate output to the Ghostscript postprocessor, in the proper sequence, afterpdf$$.tc.
π AUTHORS π
pdfroff was written by Keith Marshall, who maintains it at his groff-pdfmark OSDN site. groff's version may be withdrawn in a future release. π¦
β¨ SEE ALSO β¨
Groff: The GNU Implementation of troff, by Trent A. Fisher and Werner Lemberg, is the primary groff manual. you can browse it interactively with info groff. π
since pdfroff provides a superset of all groff capabilities, the above manual β or its terser reference page, groff(7) β may also be considered definitive references to all standard capabilities of pdfroff, with this document providing the reference to pdfroff's extended features.
while pdfroff imposes neither any restriction on, nor any requirement for, the use of any specific groff macro package, a number of supplied macro packages β and in particular those associated with the package pdfmark.tmac β are best suited for use with pdfroff as the preferred formatter. π
/usr/share/doc/groff-base/pdf/pdfmark.pdf.gzβ βPortable Document Format Publishing with GNU Troffβ, by Keith Marshall, offers detailed documentation on the use of these packages. this file, together with its source,pdfmark.ms, is part of the groff distribution.
okay bestie that's the whole page, you made it, so proud π₯Ήπ«Ά this was groff 1.23.0, dated 3 June 2025, and it's the pdfroff(1) manual β go forth and pdf, you gorgeous main character π
β¨
π¦ where this page comes from
- debian trixie: groff 1.23.0-9
- ubuntu questing: groff 1.23.0-9
- Copyright (C) 2005-2020 Free Software Foundation, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms