# phpman > man > gropdf(1)

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



## NAME
       gropdf - PDF driver for groff

## SYNOPSIS
       **gropdf** [**-dels**] [**-F** _dir_] [**-I** _dir_] [**-p** _paper-size_] [**-u** [_cmapfile_]] [**-y** _foundry_] [_file_ ...]

### gropdf -v
### gropdf --version

## DESCRIPTION
       **gropdf** translates the output of GNU **troff** to PDF.  Normally **gropdf** should be invoked by using
       the groff command with a **-Tpdf** option.  If no files are given, **gropdf** reads the standard  in‐
       put.   A  filename of **-** also causes **gropdf** to read the standard input.  PDF output is written
       to the standard output.  When **gropdf** is run by **groff** options can be passed  to  **gropdf**  using
       **groff**'s **-P** option.

       See section “Font Installation” below for a guide how to install fonts for **gropdf**.

## OPTIONS
       Whitespace is permitted between a command-line option and its argument.

### -d
              PDF.

### -e

### -F
              files; _name_ is the name of the device, usually **pdf**.

### -I
              **\X'pdf:** **pdfpic'** escape.  The current directory is always searched first.  This  option
              may be specified more than once; the directories are then searched in the order speci‐
              fied.

              No directory search is performed for files with an absolute file name.

### -l

### -p
              Set physical dimension of output medium.  This overrides the  **papersize**,  **paperlength**,
              and  **paperwidth** commands in the _DESC_ file; it accepts the same arguments as the **paper**‐‐
              **size** command.  See **groff**___**[font**(5)](https://www.chedong.com/phpMan.php/man/font/5/markdown) for details.

### -s
              ment.   Ghostscript's  **ps2pdf**  complains  about this line if it is included, but works
              anyway.

### -u
              **Gropdf** normally includes a ToUnicode CMap with any font created using _text.enc_ as  the
              encoding  file, this makes it easier to search for words which contain ligatures.  You
              can include your own CMap by specifying a _cmapfile_ or have no CMap at all by  omitting
              the argument.

### -v
### --version
              Print the version number and exit.

### -y
              Set the foundry to use for selecting fonts of the same name.

## USAGE
       The  input  to  **gropdf**  must  be  in  the  format  output  by [**troff**(1)](https://www.chedong.com/phpMan.php/man/troff/1/markdown).  This is described in
       **groff**___**[out**(5)](https://www.chedong.com/phpMan.php/man/out/5/markdown).

       In addition, the device and font description files for the device used must meet certain  re‐
       quirements:  The  resolution  must be an integer multiple of 72 times the **sizescale**.  The **pdf**
       device uses a resolution of 72000 and a sizescale of 1000.

       The device description file must contain a valid paper size; see **groff**___**[font**(5)](https://www.chedong.com/phpMan.php/man/font/5/markdown) for  more  in‐
       formation.   **gropdf**  uses  the same Type 1 Adobe PostScript fonts as the **grops** device driver.
       Although the PDF Standard allows the use of other font types (like TrueType) this implementa‐
       tion  only  accepts the Type 1 PostScript font.  Fewer Type 1 fonts are supported natively in
       PDF documents than the standard 35 fonts supported by **grops** and all PostScript printers,  but
       all  the  fonts are available since any which aren't supported natively are automatically em‐
       bedded in the PDF.

       **gropdf** supports the concept of foundries, that is different versions of  basically  the  same
       font.   During  install  a _Foundry_ file controls where fonts are found and builds **groff** fonts
       from the files it discovers on your system.

       Each font description file must contain a command

              **internalname** _psname_

       which says that the PostScript name of the font is _psname_.  Lines starting with **#**  and  blank
       lines are ignored.  The code for each character given in the font file must correspond to the
       code in the default encoding for the font.  This code can be used with the **\N** escape sequence
       in  **troff**  to  select the character, even if the character does not have a groff name.  Every
       character in the font file must exist in the PostScript font, and the  widths  given  in  the
       font file must match the widths used in the PostScript font.

       Note  that  **gropdf**  is currently only able to display the first 256 glyphs in any font.  This
       restriction will be lifted in a later version.

       **gropdf** can automatically include the downloadable fonts  necessary  to  print  the  document.
       Fonts may be in PFA or PFB format.

       Any  downloadable  fonts which should, when required, be included by **gropdf** must be listed in
       the file _/usr/share/groff/1.22.4/font/devpdf/download_; this should consist of  lines  of  the
       form

              _foundry_ _font_ _filename_

       where  _foundry_  is the foundry name or blank for the default foundry.  _font_ is the PostScript
       name of the font, and _filename_ is the name of the file containing the font;  lines  beginning
       with  **#**  and  blank  lines  are ignored; fields must be separated by tabs (spaces are **not** al‐
       lowed); _filename_ is searched for using the same mechanism that is used for groff font  metric
       files.   The  _download_ file itself is also searched for using this mechanism; currently, only
       the first found file in the font path is used.  Foundry names are usually a single  character
       (such  as  ‘U’  for the URW Foundry) or blank for the default foundry.  This default uses the
       same fonts as **ghostscript** uses when it embeds fonts in a PDF file.

       In the default setup there are styles called **R**, **I**, **B**, and **BI**  mounted  at  font  positions  1
       to  4.   The  fonts  are grouped into families **A**, **BM**, **C**, **H**, **HN**, **N**, **P**, and **T** having members in
       each of these styles:

              **AR**     AvantGarde-Book
              **AI**     AvantGarde-BookOblique
              **AB**     AvantGarde-Demi
              **ABI**    AvantGarde-DemiOblique
              **BMR**    Bookman-Light
              **BMI**    Bookman-LightItalic
              **BMB**    Bookman-Demi
              **BMBI**   Bookman-DemiItalic
              **CR**     Courier
              **CI**     Courier-Oblique
              **CB**     Courier-Bold
              **CBI**    Courier-BoldOblique
              **HR**     Helvetica
              **HI**     Helvetica-Oblique
              **HB**     Helvetica-Bold
              **HBI**    Helvetica-BoldOblique
              **HNR**    Helvetica-Narrow
              **HNI**    Helvetica-Narrow-Oblique
              **HNB**    Helvetica-Narrow-Bold
              **HNBI**   Helvetica-Narrow-BoldOblique
              **NR**     NewCenturySchlbk-Roman
              **NI**     NewCenturySchlbk-Italic
              **NB**     NewCenturySchlbk-Bold
              **NBI**    NewCenturySchlbk-BoldItalic
              **PR**     Palatino-Roman
              **PI**     Palatino-Italic
              **PB**     Palatino-Bold
              **PBI**    Palatino-BoldItalic
              **TR**     Times-Roman
              **TI**     Times-Italic
              **TB**     Times-Bold
              **TBI**    Times-BoldItalic

       There is also the following font which is not a member of a family:

              **ZCMI**   ZapfChancery-MediumItalic

       There are also some special fonts called **S** for the PS Symbol  font.   The  lower  case  greek
       characters are automatically slanted (to match the SymbolSlanted font (SS) available to Post‐
       Script).  Zapf Dingbats is available as **ZD**, the "hand pointing left" glyph (\[lh]) is  avail‐
       able since it has been defined using the \X'pdf: xrev' extension which reverses the direction
       of letters within words.

       The default color for **\m** and **\M** is black.

       **gropdf** understands some of the X commands produced using the **\X** escape sequences supported by
       **grops.**  Specifically, the following is supported.

### \X'ps: invis'
              Suppress output.

### \X'ps: endinvis'
              Stop suppressing output.

       **\X'ps:** **exec** **gsave** **currentpoint** **2** **copy** **translate** _n_ **rotate** **neg** **exch** **neg** **exch** **translate'**
              where _n_ is the angle of rotation.  This is to support the _align_ command in **gpic**.

### \X'ps: exec grestore'
              Again used by **gpic** to restore after rotation.

       **\X'ps:** **exec** _n_ **setlinejoin'**
              where _n_ can be one of the following values.

              0 = Miter join
              1 = Round join
              2 = Bevel join

       **\X'ps:** **exec** _n_ **setlinecap'**
              where _n_ can be one of the following values.

              0 = Butt cap
              1 = Round cap, and
              2 = Projecting square cap

### \X'ps: ... pdfmark'
              All the _pdfmark_ macros installed by using _-m_ _pdfmark_ or _-m_ _mspdf_ (see documentation in
              _pdfmark.pdf_).  A subset of these macros are installed automatically when you use **-Tpdf**
              so you should not need to use ‘-m pdfmark’ for using most of the PDF functionality.

       **gropdf**  also  supports  a subset of the commands introduced in present.tmac.  Specifically it
       supports:-

              PAUSE
              BLOCKS
              BLOCKE

       Which allows you to create presentation type PDFs.  Many of the other  commands  are  already
       available in other macro packages.

       These commands are implemented with **groff** X commands:-

### \X'ps: exec %%%%PAUSE
              The  section  before  this  is  treated as a block and is introduced using the current
              BLOCK transition setting (see ‘pdf: transition’ below).  This command  can  be  intro‐
              duced using the macro **.pdfpause**.

### \X'ps: exec %%%%BEGINONCE
              Any  text  following  this  command  (up  to %%%%ENDONCE) is shown only once, the next
              %%%%PAUSE will remove it.  If producing a non  presentation  pdf,  i.e.  ignoring  the
              pauses, see _GROPDF_NOSLIDE_ below, this text is ignored.

### \X'ps: exec %%%%ENDONCE
              This terminates the block defined by %%%%BEGINONCE.  This pair of commands is what im‐
              plements the .BLOCKS Once/.BLOCKE commands in present.tmac.

       The **mom** macro set already has integration with these extensions so you can build slides  with
       **mom**.

       If  you  use  present.tmac with **gropdf** there is no need to run the program [**presentps**(1)](https://www.chedong.com/phpMan.php/man/presentps/1/markdown) since
       the output will already be a presentation pdf.

       All other **ps:** tags are silently ignored.

       One **\X** special used by the DVI driver is also recognised:

       **\X'papersize=**_paper-size_**'**
              where  the  _paper-size_  parameter  is  the  same  as  the  **papersize**   command.    See
              **groff**___**[font**(5)](https://www.chedong.com/phpMan.php/man/font/5/markdown) for details.  This means that you can alter the page size at will within
              the PDF file being created by **gropdf**.  If you do want to change  the  paper  size,  it
              must be done before you start creating the page.

       In addition, **gropdf** supports its own suite of **pdf:** tags.  The following tags are supported:

       **\X'pdf:** **pdfpic** _file_ _alignment_ _width_ _height_ _line-length_**'**
              Place an image of the specified _width_ containing the PDF drawing from file _file_ of de‐
              sired _width_ and _height_ (if _height_ is missing or zero then  it  is  scaled  proportion‐
              ally).   If  _alignment_  is  **-L** the drawing is left aligned.  If it is **-C** or **-R** a _line__‐
              _length_ greater than the width of the drawing is required as well.  If _width_ is  speci‐
              fied as zero then the width is scaled in proportion to the height.

### \X'pdf: xrev'
              This  toggles  a flag which reverses the direction of printing _letter_ _by_ _letter_, i.e.,
              each separate letter is reversed, not the entire word.  This is useful  for  reversing
              the direction of glyphs in the Dingbats font.  To return to normal printing repeat the
              command again.

       **\X'pdf:** **markstart** _/ANN_ _definition_**'**
              The macros which support PDF Bookmarks use this call internally to start  the  defini‐
              tion  of bookmark hotspot (user will have called ‘.pdfhref L’ with the text which will
              become the ‘hot spot’ region).  Normally this is never used  except  from  within  the
              pdfmark macros.

### \X'pdf: markend'
              The macros which support PDF Bookmarks use this call internally to stop the definition
              of bookmark hotspot (user will have called ‘.pdfhref L’ with the text which  will  be‐
              come  the ‘hot spot’ region).  Normally this is never used except from within the pdf‐
              mark macros.

### \X'pdf: marksuspend'
### \X'pdf: markrestart'
              If you are using page traps to produce headings, footings, etc., you need to use these
              in case a ‘hot spot’ crosses a page boundary, otherwise any text output by the heading
              or footing macro will be marked as part of the ‘hot spot’.   To  stop  this  happening
              just  place  ‘.pdfmarksuspend’  and ‘.pdfmarkrestart’ at the start and end of the page
              trap macro, respectively.  (These are just convenience macros which emit the \X  code.
              These macros must only be used within page traps.)

       **\X'pdf:** **transition'**feature mode duration dimension motion direction scale bool
              where

              _feature_  can be either SLIDE or BLOCK.  When it is SLIDE the transition is used when a
              new slide is introduced to the screen, if BLOCK then this transition is used  for  the
              individual blocks which make up the slide.
              _mode_ is the transition type between slides:-

                     **Split**  -  Two lines sweep across the screen, revealing the new page.  The lines
                     may be either horizontal or vertical and may move inward from the edges of  the
                     page  or  outward from the center, as specified by the _dimension_ and _motion_ en‐
                     tries, respectively.
                     **Blinds** - Multiple lines, evenly spaced across the screen,  synchronously  sweep
                     in the same direction to reveal the new page.  The lines may be either horizon‐
                     tal or vertical, as specified by the _dimension_
                      entry.  Horizontal lines move downward; vertical lines move to the right.
                     **Box** - A rectangular box sweeps inward from the edges of  the  page  or  outward
                     from the center, as specified by the _motion_ entry, revealing the new page.
                     **Wipe** - A single line sweeps across the screen from one edge to the other in the
                     direction specified by the _direction_ entry, revealing the new page.
                     **Dissolve** - The old page dissolves gradually to reveal the new one.
                     **Glitter** - Similar to Dissolve, except that the effect sweeps across the page in
                     a  wide  band  moving from one side of the screen to the other in the direction
                     specified by the _direction_ entry.
                     **R** - The new page simply replaces the old one with no special transition effect;
                     the _direction_ entry shall be ignored.
                     **Fly**  -  (PDF  1.5) Changes are flown out or in (as specified by _motion_), in the
                     direction specified by _direction_, to or from a location that is  offscreen  ex‐
                     cept when _direction_ is **None**.
                     **Push**  -  (PDF 1.5) The old page slides off the screen while the new page slides
                     in, pushing the old page out in the direction specified by _direction_.
                     **Cover** - (PDF 1.5) The new page slides on to the screen in the direction  speci‐
                     fied by _direction_, covering the old page.
                     **Uncover**  - (PDF 1.5) The old page slides off the screen in the direction speci‐
                     fied by _direction_, uncovering the new page in the direction specified by _direc__‐
                     _tion_.
                     **Fade** - (PDF 1.5) The new page gradually becomes visible through the old one.

              _duration_ is the length of the transition in seconds (default 1).

              _dimension_  (Optional;  **Split** and **Blinds** transition styles only) The dimension in which
              the specified transition effect shall occur: **H** Horizontal, or **V** Vertical.

              _motion_ (Optional; **Split**, **Box** and **Fly** transition styles only) The direction  of  motion
              for the specified transition effect: **I** Inward from the edges of the page, or **O** Outward
              from the center of the page.

              _direction_ (Optional; **Wipe**, **Glitter**, **Fly**, **Cover**, **Uncover**  and  **Push**  transition  styles
              only) The direction in which the specified transition effect shall moves, expressed in
              degrees counterclockwise starting from a left-to-right direction.  If the value  is  a
              number,  it  shall be one of: **0** = Left to right, **90** = Bottom to top (Wipe only), **180** =
              Right to left (Wipe only), **270** = Top to bottom, **315** = Top-left to bottom-right  (Glit‐
              ter  only)  The  value can be **None**, which is relevant only for the **Fly** transition when
              the value of _scale_ is not 1.0.

              _scale_ (Optional; PDF 1.5; **Fly** transition style only) The starting or ending  scale  at
              which the changes shall be drawn.  If _motion_ specifies an inward transition, the scale
              of the changes drawn shall progress from _scale_ to 1.0 over the course of  the  transi‐
              tion.  If _motion_ specifies an outward transition, the scale of the changes drawn shall
              progress from 1.0 to _scale_ over the course of the transition

              _bool_ (Optional; PDF 1.5; **Fly** transition style only) If **true**, the area  that  shall  be
              flown in is rectangular and opaque.

              This  command can be used by calling the macro **.pdftransition** using the parameters de‐
              scribed above.  Any of the parameters may be replaced with a "." which  signifies  the
              parameter  retains  its  previous  value, also any trailing missing parameters are ig‐
              nored.

              **Note:** not all PDF Readers support any or all these transitions.

### Importing graphics
       **gropdf** only supports importing other PDF files as graphics.  But that PDF  file  may  contain
       any  of the graphic formats supported by the PDF standard (such as JPEG, PNG, GIF, etc.).  So
       any application which outputs PDF can be used as an embedded file in **gropdf**.   The  PDF  file
       you  wish to insert must be a single page and the drawing must just fit inside the media size
       of the PDF file.  So, in [**inkscape**(1)](https://www.chedong.com/phpMan.php/man/inkscape/1/markdown) or [**gimp**(1)](https://www.chedong.com/phpMan.php/man/gimp/1/markdown) (for example) make sure the canvas size  just
       fits the image.

       The  PDF  parser used in **gropdf** has not been rigorously tested with all possible applications
       which produce PDFs.  If you find a single page PDF which fails  to  import  properly,  it  is
       worth running it through the [**pdftk**(1)](https://www.chedong.com/phpMan.php/man/pdftk/1/markdown) program by issuing the command:

              **pdftk** _oldfile.pdf_ **output** _newfile.pdf_

       You may find that _newfile.pdf_ will now load successfully.

### TrueType and other font formats
       **gropdf** does not support any other fonts except Adobe Type 1 (PFA or PFB).

## FONT INSTALLATION
       This  section  gives a summary of the above explanations; it can serve as a step-by-step font
       installation guide for **gropdf**.

        •  Convert your font to something groff understands.  This is either  a  PostScript  Type  1
           font in either PFA or PFB, together with an AFM file.

           The very first line in a PFA/PFB file contains this:

                  **%!PS-AdobeFont-1.0:**

           A  PFB  file has this also in the first line, but the string is preceded with some binary
           bytes.

        •  Convert the AFM file to a groff font description file with the [**afmtodit**(1)](https://www.chedong.com/phpMan.php/man/afmtodit/1/markdown)  program.   An
           example call is

                  afmtodit Foo-Bar-Bold.afm map/textmap FBB

           which converts the metric file ‘Foo-Bar-Bold.afm’ to the groff font ‘FBB’.  If you have a
           font family which comes with normal, bold, italic, and bold italic faces,  it  is  recom‐
           mended  to  use the letters **R**, **B**, **I**, and **BI**, respectively, as postfixes in the groff font
           names to make groff's ‘.fam’ request work.  An example is  groff's  built-in  Times-Roman
           font: The font family name is **T**, and the groff font names are **TR**, **TB**, **TI**, and **TBI**.

        •  Install both the groff font description files and the fonts in a ‘devpdf’ subdirectory of
           the font path which groff finds.  See section “Environment” in [**troff**(1)](https://www.chedong.com/phpMan.php/man/troff/1/markdown)  for  the  actual
           value of the font path.  Note that groff doesn't use the AFM files (but it is a good idea
           to store them anyway).

        •  Register all fonts which must be downloaded to the printer in the  _devpdf/download_  file.
           Only  the  first  occurrence  of this file in the font path is read.  This means that you
           should copy the default _download_ file to the first directory in your font  path  and  add
           your  fonts  there.   To  continue  the above example we assume that the PS font name for
           Foo-Bar-Bold.pfa is ‘XY-Foo-Bar-Bold’ (the PS font name is  stored  in  the  **internalname**
           field in the _FBB_ file) and belongs to foundry ‘F’ thus the following line should be added
           to _download_:

                  **F** **XY-Foo-Bar-Bold** **Foo-Bar-Bold.pfa**

           Use a tab character to separate the fields, and the ‘foundry’ field should  be  null  for
           the default foundry.

## ENVIRONMENT
       _GROFF_FONT_PATH_
              A  list of directories in which to search for the _dev_name directory in addition to the
              default ones.  If, in the _download_ file, the font file has been specified with a  full
              path, no directories are searched.  See [**troff**(1)](https://www.chedong.com/phpMan.php/man/troff/1/markdown) and **groff**___**[font**(5)](https://www.chedong.com/phpMan.php/man/font/5/markdown) for more details.

       _GROPDF_NOSLIDE_
              If this is set true, **gropdf** will ignore all commands which produce a presentation pdf,
              and produce a normal pdf instead.

       _SOURCE_DATE_EPOCH_
              A timestamp (expressed as seconds since the Unix epoch) to use as the  creation  time‐
              stamp in place of the current time.

## FILES
       _/usr/share/groff/1.22.4/font/devpdf/DESC_
              Device description file.

       _/usr/share/groff/1.22.4/font/devpdf/_F
              Font description file for font _F_.

       _/usr/share/groff/1.22.4/font/devpdf/_U-F
              Font description file for font _F_ (using foundry _U_ rather than the default foundry).

       _/usr/share/groff/1.22.4/font/devpdf/download_
              List of downloadable fonts.

       _/usr/share/groff/1.22.4/font/devpdf/Foundry_
              A Perl script used during install to locate suitable fonts.

       _/usr/share/groff/1.22.4/font/devpdf/enc/text.enc_
              Encoding used for text fonts.

       _/usr/share/groff/1.22.4/tmac/pdf.tmac_
              Macros for use with **gropdf**; automatically loaded by **troffrc**.

## SEE ALSO
       [**afmtodit**(1)](https://www.chedong.com/phpMan.php/man/afmtodit/1/markdown), [**groff**(1)](https://www.chedong.com/phpMan.php/man/groff/1/markdown), [**troff**(1)](https://www.chedong.com/phpMan.php/man/troff/1/markdown), **groff**___**[font**(5)](https://www.chedong.com/phpMan.php/man/font/5/markdown), **groff**___**[out**(5)](https://www.chedong.com/phpMan.php/man/out/5/markdown)



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