# pdfroff(1) - man - phpman

[PDFROFF(1)](https://www.chedong.com/phpMan.php/man/PDFROFF/1/markdown)                             General Commands Manual                            [PDFROFF(1)](https://www.chedong.com/phpMan.php/man/PDFROFF/1/markdown)



## NAME
       pdfroff - create PDF documents using groff

## SYNOPSIS
       **pdfroff** [**-abcegilpstzCEGNRSUVXZ**] [**-d** _cs_] [**-f** _fam_] [**-F** _dir_] [**-I** _dir_] [**-L** _arg_] [**-m** _name_]
               [**-M** _dir_] [**-n** _num_] [**-o** _list_] [**-P** _arg_] [**-r** _cn_] [**-T** _dev_] [**-w** _name_] [**-W** _name_] [**--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_ ...]

## DESCRIPTION
       **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  docu‐
       ment.   A  further optional “style sheet” capability is provided; this allows for the defini‐
       tion of content which is required to precede the table of contents, in  the  published  docu‐
       ment.

       For  each  invocation  of  **pdfroff**, the ultimate **groff** output stream is post-processed by the
       GhostScript 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 ref‐
       erence  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 refer‐
       ences, 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 sin‐
       gle  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 inter‐
       nally  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** ac‐
       cepts  all  options  and arguments, as specified in [**groff**(1)](https://www.chedong.com/phpMan.php/man/groff/1/markdown), which may also be considered as
       the definitive reference for all standard **pdfroff** options and argument usage.

## OPTIONS
       **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 --help

### -i
              parently  to  **groff**,  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
              pass **groff** processing context of **pdfroff**.

### -T -T
              **pdfroff** to abort.

### -v --version

       See [**groff**(1)](https://www.chedong.com/phpMan.php/man/groff/1/markdown) 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** Causes **pdfroff** to display a summary of the its usage syntax,  and  supported  options,
              and then exit.

### --emit-ps
              Suppresses the final output conversion step, causing **pdfroff** to emit PostScript output
              instead of PDF.  This may be useful, to capture intermediate PostScript  output,  when
              using  a  specialised postprocessor, such as _gpresent_ for example, in place of the de‐
              fault _GhostScript_ PDF writer.

### --keep-temporary-files
              Suppresses the deletion of temporary files, which normally occurs  after  **pdfroff**  has
              completed PDF document formatting; this may be useful, when debugging formatting prob‐
              lems.

              See section “Files” below for a description of the temporary files used by **pdfroff**.

### --no-pdf-output
              May be used with the **--reference-dictionary=**_name_ option (described below) to eliminate
              the overhead of PDF formatting, when running **pdfroff** to 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 the
              _pdfhref_ macro.

### --no-toc-relocation
              May be used to eliminate the extra **groff** processing pass, which is required to  gener‐
              ate  a  table of contents, and relocate it to the start of the PDF document, when pro‐
              cessing 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, **pdfroff** accumu‐
              lates 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 forces **pdfroff** to 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 of **pdfroff** may use this op‐
              tion, 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 unspeci‐
              fied,  the  reference dictionary is created in a temporary file, which is deleted when
              **pdfroff** completes 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
              Causes **pdfroff** to display an informational message on standard error, at the start  of
              each **groff** processing 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 doc‐
              ument.

### --version
              Causes  **pdfroff**  to display a version identification message.  The entire command line
              is then passed transparently to **groff**, in a _one_ pass operation _only_, in order to  dis‐
              play the associated **groff** version information, before exiting.

## ENVIRONMENT
       The  following  environment  variables  may  be set, and exported, to modify the behaviour of
       **pdfroff**.

       _PDFROFF_COLLATE_
              Specifies the program to be used for collation of the finished PDF document.

              This collation step may be required to move _tables_ _of_ _contents_ to  the  start  of  the
              finished  PDF  document,  when formatting with traditional macro packages, which print
              them at the end.  However, users should not normally need to specify  _PDFROFF_COLLATE_,
              (and indeed, are not encouraged to do so).  If unspecified, **pdfroff** uses [**sed**(1)](https://www.chedong.com/phpMan.php/man/sed/1/markdown) by de‐
              fault, which normally suffices.

              If _PDFROFF_COLLATE_ _is_ specified, then it must act as a filter,  accepting  a  list  of
              file  name arguments, and write its output to the _stdout_ stream, whence it is piped to
              the _PDFROFF_POSTPROCESSOR_COMMAND_, to produce the finished PDF output.

              When  specifying  _PDFROFF_COLLATE_,  it  is  normally   necessary   to   also   specify
              _PDFROFF_KILL_NULL_PAGES_.

              _PDFROFF_COLLATE_  is  ignored,  if **pdfroff** is invoked with the _--no-kill-null-pages_ op‐
              tion.

       _PDFROFF_KILL_NULL_PAGES_
              Specifies options to be passed to the _PDFROFF_COLLATE_ program.

              It should not normally be necessary to specify _PDFROFF_KILL_NULL_PAGES_.  The  internal
              default  is  a  [**sed**(1)](https://www.chedong.com/phpMan.php/man/sed/1/markdown) script, which is intended to remove completely blank pages from
              the collated output stream, and which should be appropriate in  most  applications  of
              **pdfroff**.  However, if any alternative to [**sed**(1)](https://www.chedong.com/phpMan.php/man/sed/1/markdown) is specified for _PDFROFF_COLLATE_, then
              it   is    likely    that    a    corresponding    alternative    specification    for
              _PDFROFF_KILL_NULL_PAGES_ is required.

              As  in  the case of _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 to be used for the final document conversion from PostScript in‐
              termediate  output to PDF.  It must behave as a filter, writing its output to the _std__‐
              _out_ stream, and must accept an arbitrary number of _files_ _..._ arguments, with the  spe‐
              cial case of _-_ representing the _stdin_ stream.

              If unspecified, _PDFROFF_POSTPROCESSOR_COMMAND_ defaults to
                   gs -dBATCH -dQUIET -dNOPAUSE -dSAFER -sDEVICE=pdfwrite \
                        -sOutputFile=-

       _GROFF_TMPDIR_
              Identifies  the  directory  in  which  **pdfroff**  should  create  temporary  files.   If
              _GROFF_TMPDIR_ is _not_ specified, then the variables _TMPDIR_, _TMP_ and _TEMP_ are  considered
              in turn, as possible temporary file repositories.  If none of these are set, then tem‐
              porary files are created in the current directory.

       _GROFF_GHOSTSCRIPT_INTERPRETER_
              Specifies the program to be invoked, when **pdfroff** converts **groff** PostScript output  to
              PDF.   If  _PDFROFF_POSTPROCESSOR_COMMAND_ is specified, then the command name it speci‐
              fies is _implicitly_ assigned to _GROFF_GHOSTSCRIPT_INTERPRETER_, overriding any  explicit
              setting  specified in the environment.  If _GROFF_GHOSTSCRIPT_INTERPRETER_ is not speci‐
              fied, then **pdfroff** searches the process _PATH_, looking for a program with  any  of  the
              well known names for the GhostScript interpreter; if no GhostScript interpreter can be
              found, **pdfroff** aborts.

       _GROFF_AWK_INTERPRETER_
              Specifies the program to be invoked, when **pdfroff** is extracting  reference  dictionary
              entries  from  a  **groff**  intermediate message stream.  If _GROFF_AWK_INTERPRETER_ is not
              specified, then **pdfroff** searches the process _PATH_, looking for any  of  the  preferred
              programs,  ‘gawk’,  ‘mawk’,  ‘nawk’,  and  ‘awk’,  in this order; if none of these are
              found, **pdfroff** issues a warning message, and continue  processing;  however,  in  this
              case, no reference dictionary is created.

       _OSTYPE_ Typically  defined  automatically by the operating system, _OSTYPE_ is used on Microsoft
              Win32/MS-DOS platforms _only_, to infer the default _PATH_SEPARATOR_ character,  which  is
              used when parsing the process _PATH_ to search for external helper programs.

       _PATH_SEPARATOR_
              If  set,  _PATH_SEPARATOR_ overrides the default separator character, (‘:’ on POSIX/Unix
              systems, inferred from _OSTYPE_ on Microsoft Win32/MS-DOS), which is used  when  parsing
              the process _PATH_ to search for external helper programs.

       _SHOW_PROGRESS_
              If  this  is  set  to  a  non-empty  value,  then  **pdfroff**  always  behaves  as if the
              **--report-progress** option 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 format‐
       ting 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 section “Environment” above).  If [**mktemp**(1)](https://www.chedong.com/phpMan.php/man/mktemp/1/markdown)
       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  this
       subdirectory is successfully created, the temporary files will be placed within it, otherwise
       they will be placed 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 ID of the **pdfroff** process itself, and _*_ rep‐
       resents any of the extensions used by **pdfroff** to identify the following temporary and  inter‐
       mediate files.

       _pdf_$$_.tmp_
              A scratch pad file, used to capture reference data emitted by **groff**, during the _refer__‐
              _ence_ _dictionary_ compilation phase.

       _pdf_$$_.ref_
              The _reference_ _dictionary_, as compiled in the last but one pass of the  _reference_  _dic__‐
              _tionary_  compilation  phase;  (at  the  start  of the first pass, this file is created
              empty; in successive passes, it contains the _reference_  _dictionary_  entries,  as  col‐
              lected 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 of _pdf_$$_.cmp_
              compares  as  identical  to  _pdf_$$_.ref_,  (or  the  corresponding  file  named  by  the
              **--reference-dictionary**=_name_  option),  then _reference_ _dictionary_ compilation is termi‐
              nated, and the _document_ _reference_ _map_ is appended to this intermediate file,  for  in‐
              clusion 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, _after_ _pdf_$$_.tc_.

## AUTHORS
       **pdfroff** was written by Keith Marshall ⟨<keith.d.marshall@ntlworld.com>⟩.

## SEE ALSO
       See [**groff**(1)](https://www.chedong.com/phpMan.php/man/groff/1/markdown) for the definitive reference to document formatting with **groff**.   Since  **pdfroff**
       provides  a superset of all **groff** capabilities, [**groff**(1)](https://www.chedong.com/phpMan.php/man/groff/1/markdown) may also be considered to be the de‐
       finitive reference 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 pre‐
       ferred formatter.  Detailed documentation on the use of these packages may be found,  in  PDF
       format, in the reference guide ““**Portable** **Document** **Format** **Publishing** **with** **GNU** **Troff**””, included
       in the installed documentation set as _/usr/share/doc/groff-base/pdf/pdfmark.pdf.gz_.



groff 1.22.4                                23 March 2022                                 [PDFROFF(1)](https://www.chedong.com/phpMan.php/man/PDFROFF/1/markdown)
