gropdf |
[-delvs] [-F dir] [-p papersize] [-y foundry] [-u [cmapfile]] [files ...] |
It is possible to have whitespace between a command line option and its parameter.
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 input. 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.
The input to gropdf must be in the format output by troff(1). This is described in groff_out(5).
In addition, the device and font description files for the device used must meet certain requirements: 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) for more information. 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 implementation 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 embedded 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
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.3/font/devpdf/download; this should consist of lines of the form
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 allowed); 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:
There is also the following font which is not a member of a family:
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 postscript). Zapf Dingbats is available as ZD, the "hand pointing left" glyph (\[lh]) is available 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; for colors defined in the ‘rgb’ color space setrgbcolor is used, for ‘cmy’ and ‘cmyk’ setcmykcolor, and for ‘gray’ setgray. Note that setcmykcolor is a PostScript LanguageLevel 2 command and thus not available on some older printers.
gropdf understands some of the X commands produced using the \X escape sequences supported by grops. Specifically, the following is supported.
All other ps: tags are silently ignored.
One \X special used by the DVI driver is also recognised:
In addition, gropdf supports its own suite of pdf: tags. The following tags are supported:
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) or gimp(1) (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) program by issuing the command:
pdftk oldfile.pdf output newfile.pdf
You may find that newfile.pdf will now load successfully.
gropdf does not support any other fonts except Adobe Type 1 (PFA or PFB).
This section gives a summary of the above explanations; it can serve as a step-by-step font installation guide for gropdf.
Use a tab character to separate the fields, and the ‘foundry’ field should be null for the default foundry.
afmtodit(1), groff(1), grops(1), troff(1), grops(1), pfbtops(1), groff_out(5), groff_font(5), groff_char(7), groff_tmac(5)
Copyright © 2011-2014 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies.
Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one.
Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be included in translations approved by the Free Software Foundation instead of in the original English.