gropdf(1)
okay bestie, welcome to gropdf(1) from the General Commands Manual β this is the groff output driver for Portable Document Format and it's lowkey iconic π
β¨
π NAME π
gropdf β groff output driver for Portable Document Format π¦
πΈ SYNOPSIS πΈ
gropdf [-delsW] [{-f|--format-options} bit-vector] [-F font-directory]
[-I inclusion-directory] [-p paper-format] [--pdfver {1.4|1.7}]
[-u [cmap-file]] [-y foundry] [file ...]
gropdf --help
gropdf -v
gropdf --version
β¨ DESCRIPTION β¨
okay so, the GNU roff PDF output driver translates the output of troff(1) into Portable Document Format. Normally, gropdf is invoked by groff(1) when the latter is given the -T pdf option. (In this installation, ps is the default output device.) Use groff's -P option to pass any options shown above to gropdf.
If no file arguments are given, or if file is -, gropdf reads the standard input stream. It writes to the standard output stream. standard in, standard out, no cap π«Ά
See section βFont installationβ below for a guide to installing fonts for gropdf.
π OPTIONS π
--help displays a usage message, while -v and --version show version information; all exit afterward. like, they do their little thing and dip π
-dβ Include debug information as comments within the PDF. Also produces an uncompressed PDF.-eβ Forcesgropdfto embed all fonts (even the 14 base PDF fonts).--format-optionsbit-vector,-fbit-vector β Specify advanced options forgropdf. Familiarity with the ISO 32000 PDF standard is helpful. The bit-vector argument is an integer that configures characteristics of the generated PDF. Add the following values to combine them.1β Subset included Type 1 fonts.2β Use more compact format for text by including space as a character. Fonts that do not include space as a glyph may conflict with this feature.4β Compress all data streams.8β Don't embed font files. (A font required by the document is not embedded; usually not useful.)
The default feature combination is 7. To mimic what gropdf from groff 1.23 produced, specify 6 to turn off subsetting.
-Fdir β Prepend directorydir/devnameto the search path for font, and device description files; name is the name of the device, usuallypdf.-Idir β Search the directory dir for files named in\X'pdf: pdfpic'device extension commands.-Imay be specified more than once; each dir is searched in the given order. To search the current working directory before others, add-I .at the desired place; it is otherwise searched last.-lβ Orient the document in landscape format.-ppaper-format β Set the physical dimensions of the output medium. This overrides thepapersize,paperlength, andpaperwidthdirectives in theDESCfile; it accepts the same arguments as thepapersizedirective. Seegroff_font(5)for details.--pdfver {1.4|1.7}β PDF version 1.7 introduced a more compact object format; this is now the default. If you require the original format (as produced bygropdf1.23) set the version to1.4.-sβ Append a comment line to end of PDF showing statistics, i.e. number of pages in document. Ghostscript'sps2pdfcomplains about this line if it is included, but works anyway.-u [cmap-file]βgropdfnormally includes a ToUnicode CMap with any font created usingtext.encas the encoding file; this makes it easier to search for words which contain ligatures. You can include your own CMap by specifying a cmap-file or have no CMap at all by omitting the argument.-Wβ Exit with failure status if any warnings are issued.-yfoundry β Set the foundry to use for selecting fonts of the same name.
π¦ USAGE π¦
gropdf's input must be in the format produced by troff(1) and described in groff_out(5). Further, its device and font description files must meet certain requirements. The device resolution must be an integer multiple of 72 times sizescale. By default, gropdf uses a resolution of 72000 and a sizescale of 1000. A valid paper format is mandatory; see groff_font(5).
While the PDF standard allows several font file formats (like TrueType), at present gropdf accepts only the same Type 1 Adobe PostScript format as grops(1). Fewer Type 1 fonts are supported natively in PDF documents than the standard 35 fonts supported by grops and PostScript printers, but all are available since gropdf automatically embeds any that aren't specified by the PDF standard. π«Ά
gropdf supports foundries that permit multiple providers to supply the same groff font names. groff's compilation process attempts to locate Type 1 fonts on the system, populates a Foundry file with their locations, and generates font description files corresponding to them. Font description files can also be added after installation. Each such file must contain a directive
internalname psname
that maps the groff font name (such as TR) to a PostScript name (such as Times-Roman). 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 it lacks a special character name. Every character in the font description must exist in the font file, and the widths given in the description must match those used in the font file. See groff_font(5).
gropdf can automatically embed any downloadable fonts necessary to print the document. Any fonts thus required must be listed in the file /usr/share/groff/1.24.2/font/devpdf/download, which should comprise lines of the form
foundry font file-name
where foundry is the foundry name, or blank for the default foundry; font is the PostScript name of the font, and file-name is the name of the PFA or PFB font file, and can be a pathname (can contain slashes). Any lines beginning with # and blank lines are ignored; fields must be separated by tabs (spaces are not allowed); if file-name is not a pathname, it is sought using the same mechanism as that used for font metric files. The download file itself is also sought using this mechanism. Foundry names are usually a single character (such as U for the URW foundry) or empty for the default foundry. This default uses the same fonts as Ghostscript uses when it embeds fonts in a PDF file.
The default stroke and fill colors are black. π€
π TYPEFACES π
Styles called R, I, B, and BI mounted at font positions 1 to 4. Text fonts are grouped into families A, BM, C, H, HN, N, P, and T, each having members in each of these styles. here's the whole font fam, literally:
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
Another text font is not a member of a family.
ZCMI ZapfChancery-MediumItalic
Special fonts include S, the PostScript Symbol font; SS, a subset of S with slanted lowercase Greek letters; EURO, which offers a Euro glyph in several styles for use with old devices lacking it; and ZD, Zapf Dingbats. In contrast to grops, gropdf does not require a reversed variant of it (ZDR); the βhand pointing leftβ glyph (\[lh]) is available nevertheless, since pdf.tmac defines it using the \X'pdf: xrev' device extension command (see below). Some glyphs in these fonts are unnamed and must be accessed as indexed characters, using the \N escape sequence.
The fonts corresponding to EURO and SS are unknown to the PDF standard; groff therefore provides their AFM files (font metrics) and PFA or PFB files so that they can be used with other software and embedded in PDF output. β¨
π₯ FEATURE SERVICE LEVELS AND URW FONT SUPPORT π₯
The traditional PostScript Type 1 fonts are limited in their glyph repertoire, and the original versions from the Adobe foundry are not free software. Historically, because their presence was mandated by the PostScript standard, one could expect to find support for them in any conforming device or software PostScript renderer. PostScript (βLevel 1β) initially standardized 14 typefaces: Times, Helvetica, and Courier each in four styles (which groff groups into βfamiliesβ); a symbol font; and a dingbats font. PostScript Level 2 increased the number to 35, adding the families Avant Garde, Bookman, Helvetica Narrow, New Century Schoolbook, and Palatino; and a text font in one style, Zapf Chancery medium italic.
A document could be small because it did not need to embed font resources unless it had unusual (for the time) glyph or typeface requirements. This situation carried over into the early years of PostScript's successor page description language, PDF. Nowadays, it is common to embed fonts in PDFs, and authorities widely recommend this practice, which increases the reliability of document rendering, and many free software fonts are available with much greater glyph coverage than Adobe's Type 1 fonts for PostScript. the more you know, bestie π
gropdf attempts to work in variety of scenarios, and delivers better results when configured with supporting digital font files (for embedding) and font metrics files describing those fonts to the formatter. π
- Full service is what you get when
gropdfcan locate all 35 fonts of the PostScript Level 2 standard on the file system, together with their matching font metrics (AFM) files. The Adobe-compatible unnamed (default) foundry supports up to 256 glyphs in each typeface. Fonts from the URW foundry (βUβ) are compatible extensions of the Adobe fonts with extended glyph coverage, including support for Cyrillic script. groff's build process usesafmtodit(1)to generate font description files from the URW foundry's AFM files β see the section βFilesβ below, bestie, it's all documented π - Intermediate service kicks in when
gropdfcan locate all 35 fonts of the PostScript Level 2 standard but not their corresponding font metrics (AFM) files. groff's build process copies the font description files from those for thegrops(1)driver and reuses them forgropdf. The tradeoff: glyph coverage drops to 256 glyphs max from each face, and the βUβ foundry is justβ¦ not available π - Basic service results when
gropdfcannot locate all 35 fonts of the PostScript Level 2 standard. Only the base 14 fonts of the PDF standard are available, and only in the sense that the formatter can use their metrics (copied fromgrops()font descriptions as described above). And heads up: using the-eoption to embed fonts in the generated PDF results in an error. Like, an actual error. Not a vibe π«
β¨ Device extension commands β¨
gropdf supports a whole bunch of device extensions, accessed with the groff request device or the roff \X escape sequence. First things first: it understands many of the device extensions supported by grops(1). Iconic of it, honestly π
\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 exists to support thealigncommand inpic(1)π\X'ps: exec grestore'β used bypic(1)to restore state after rotation\X'ps: exec n setlinejoin'β where n can be one of these values:0= Miter join1= Round join2= Bevel join
\X'ps: exec n setlinecap'β where n can be one of these values:0= Butt cap1= Round cap, and2= Projecting square cap
gropdf also supports a subset of the commands introduced in gpresent's present.tmac:
PAUSEBLOCKSBLOCKE
These let you create presentation PDFs β¨ Many of the other commands are already available in other macro packages, so no stress.
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 currentBLOCKtransition setting (see β\X'pdf: transition'β below). Equivalently,.pdfpauseis available as a macro π¬\X'ps: exec %%%%BEGINONCE'β any text following this command (up to%%%%ENDONCE) is shown only once; the next%%%%PAUSEwill remove it. If you're producing a non-presentation PDF, i.e. ignoring the pauses, seeGROPDF_NOSLIDEbelow β then this text is ignored entirely.\X'ps: exec %%%%ENDONCE'β this terminates the block defined by%%%%BEGINONCE. This pair of commands is literally what implements the.BLOCKS Once/.BLOCKEcommands inpresent.tmacπ«Ά
The mom macro package already integrates these extensions, so you can build slides with mom. Slay.
If you use present.tmac with gropdf there is no need to run the program presentps(1) β the output will already be a presentation PDF. We love efficiency π
All other ps: tags are silently ignored. Rude but fair π
gropdf also recognizes a device extension used by the DVI driver.
\X'papersize=width,length'β set the page dimensions in centimeters to width by length. If the-loption was specified, these dimensions are swapped. Changes to the paper dimensions should occur prior to the first page, or during page ejection before starting a subsequent one.
β οΈ Caution: the ordering of dimensions differs from that used bypapersize.tmacandtroff(1)'s β-d paperβ option. Do not get caught lacking on the order, bestie π¨
\X'pdf: markstart /ANN-definition' and \X'pdf: markend' π
Macros that support PDF features use these extension commands internally to bracket hotspot text (a hyperlink). User documents should call the .pdfhref macro instead β that's the one you want, fr fr. Their application is found in other macro packages (like groff_man(7) or groff_mdoc(7)) that call .pdfhref with a -S argument, then indicate the end of hotspot text with \X'pdf: markend'\m[\*[pdf:curcol]].
\X'pdf: xrev' πͺ
Toggle the reversal of glyph direction. This feature works by reversing all following text. Each separate letter is also mirrored. One application is the reversal of glyphs in the Zapf Dingbats font. To restore the normal glyph orientation, repeat the command. It's giving mirror dimension, no cap.
gropdf supports several more device extensions using the pdf: tag. The following have counterpart convenience macros that take the same arguments and behave equivalently πΈ
.pdfbackground cmd left top right bottom weight
.pdfbackground off
.pdfbackground footnote bottom
\X'pdf: background cmd left top right bottom weight'
\X'pdf: background off'
\X'pdf: background footnote bottom' π¨
Produce a background rectangle on the page.
cmdβ is the command, which can be any of βpage|fill|boxβ in combination. Thus, βpagefillβ would draw a rectangle which covers the whole current page size (in which case the rest of the parameters can be omitted because the box dimensions are taken from the current media size). βboxfillβ, on the other hand, requires the given dimensions to place the box. Including βfillβ in the command paints the rectangle with the current fill colour (as with\M[]) and including βboxβ gives the rectangle a border in the current stroke colour (as with\m[]).
cmd may also be βoffβ on its own, which terminates drawing the current box. If you have specified a page colour with βpagefillβ, it is always the first box in the stack, and if you specify it again, it replaces the first entry. Be aware that the βpagefillβ box renders the page opaque, so tools that βwatermarkβ PDF pages are unlikely to be successful π« To return the background to transparent, issue an βoffβ command with no other boxes open.
Finally, cmd may be βfootnoteβ followed by a new value for bottom, which is used for all open boxes on the current page. This is to allow room for footnote areas that grow while a page is processed (to accommodate multiple footnotes, for instance). If the value is negative, it is used as an offset from the bottom of the page.
lefttoprightbottomβ are the coordinates of the box. The top and bottom coordinates are the minimum and maximum for the box, since the actual start of the box is groff's drawing position when you issue the command, and the bottom of the box is the point where you turn the box βoffβ. The top and bottom coordinates are used only if the box drawing extends onto the next page; ordinarily, they would be set to the header and footer margins πweightβ provides the line width for the border if βboxβ is included in the command.
An sboxes macro file is also available; see groff_tmac(5) π
.pdfmarksuspend
.pdfmarkrestart
\X'pdf: marksuspend'
\X'pdf: markrestart' βΈοΈ
If you use a page location trap to produce a header or footer, or otherwise interrupt a document's text, you need to use these commands if a PDF hotspot crosses a trap boundary β otherwise any text output by the trap will be marked as part of the hotspot. Which is not the vibe. To prevent this error, place these device extension escape sequences or their corresponding convenience macros .pdfmarksuspend and .pdfmarkrestart at the start and end of the trap macro, respectively π
.pdfpagename name
\X'pdf: pagename name' π·οΈ
Assign the current page a name. All documents bear two default names, βtopβ and βbottomβ.
.pdfpagenumbering type prefix start
\X'pdf: pagenumbering type prefix start' π’
Control the page numbering shown in a PDF reader's outline (which also contains bookmarks, iykyk). Normally, the page number associated with each bookmark is its sequence number in the file, but this might not match the desired numbering scheme. A document may bear a cover sheet (which has no page number); front matter (possibly including a table of contents) that uses lowercase roman numerals; the main matter, which uses arabic numerals; and back matter, which may include appendices that are each prefixed with a letter and independently numbered. Place this command prior to breaking the page to which the new numbering scheme is to apply. It then persists until changed again. Main character energy honestly π
typeβ specifies the numbering system to use. It should be one of βDecimalβ, βRomanβ, βromanβ, βAlphaβ, or βalphaβ. This parameter may be abbreviated to the first letter, whose lettercase determines that used for the numbers where applicable. The ordering used by the alphabetic numbering systems isA-Z ... AA-AZ ... ZA-ZZ.typecan also be β.β, which selects no numbering system; you may still provide a prefix.prefixβ specifies text to precede the page number. For example, to number the pages of an appendix βA-1β, βA-2β, and so forth, use a prefix of βA-β and a type of βDecimalβ.startβ determines the page number. It defaults to1β¨.pdfpic file alignment width height line-length\X'pdf: pdfpic file alignment width height line-length'β drops in an image from file with the width and height you want. If height is missing or zero, it gets scaled proportionally instead. If alignment is-Lthe drawing is left-aligned; if it's-Cor-Ryou also need a line-length that's bigger than the width of the drawing. If width is zero then the width gets scaled in proportion to the height. And if both width and height are non-zero, the image is scaled to βbest fitβ. π
Ngl bestie, what image files gropdf can actually embed depends on what other software you've got installed β stuff like PerlMagick matters here. Here's the vibe check:
.pdfβnone: β,file(1): β,identify(1): β,Image::Magick(3pm): β.jpgβnone: β,file(1): β,identify(1): β,Image::Magick(3pm): β.jp2βnone: β,file(1): β,identify(1): β,Image::Magick(3pm): βotherβnone: β,file(1): β,identify(1): β,Image::Magick(3pm): β
Go read groff_tmac(5) for the whole story on the PDFPIC macro β it's the convenient high-level interface for including all the various graphic file formats, and it's iconic for it. π
.pdfswitchtopage when name\X'pdf: switchtopage when name'β okay so normally every new page just gets appended to the end of the document, right? This command lets the following pages get inserted at a βnamedβ position inside the document instead (peep thepagenamecommand above). when can be either βafterβ or βbeforeβ, and if you leave it out it defaults to βbeforeβ. Use it at the end of the page before the one where you want the switch to happen. This is how you move pages like a TOC somewhere else in the document, but honestly you can get way more esoteric with it. β¨.pdftransition scope mode duration dimension motion direction scale bool\X'pdf: transition scope mode duration dimension motion direction scale bool'β this one configures the style of page transitions, like the ones you see in βslidesβ (or βfoilsβ). scope is eitherSLIDEorBLOCK:SLIDEapplies the transition when a new slide comes on screen,BLOCKapplies it to the individual blocks that make up the slide.
mode is the transition type between slides, and there are a lot of them:
- 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 entries, 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 horizontal 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 β As
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 except 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 specified by direction, covering the old page.
- Uncover β (PDF 1.5) The old page slides off the screen in the direction specified by direction, uncovering the new page in the direction specified by direction.
- 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) is the dimension in which the specified transition effect shall occur: H Horizontal, or V Vertical.
motion (Optional; Split, Box and Fly transition styles only) is 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) is 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 (Glitter 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) is 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 transition. 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.
Any of the parameters may be replaced with a . which signifies the parameter retains its previous value, also any trailing missing parameters are ignored. π«Ά
Heads up bestie: not all PDF Readers support any or all these transitions. Like, at all. π
π Macros π
gropdf's support macros live in pdf.tmac and they define all the convenience macros described above. Some features have no direct device extension escape sequence counterpart, so these are the moment, fr fr. π
.pdfbookmark [-T tag-name] level textβ Marks the nearest page location as a bookmark, and optionally a named destination as well. Bookmarks populate the outline pane of the reader, and they're organized into a hierarchical tree; each level of the tree is numbered, starting at1, and named as text in the outline. Named destinations permit hyperlink-style navigation within the document. Specifying-Tfollowed by tag-name creates a named destination making the page location eligible as a target named by β.pdfhref L ...β..pdfhref L -D dest [-S] [-P prefix-text] [-A suffix-text] [link-text]β Creates a hotspot link to dest, (the tag-name) which a β.pdfbookmark ...β or β.pdfhref M ...β call elsewhere in the document should define. (If the document employs forward references, it must be processed twice; seepdfmom(1).) If link-text is omitted, the text associated with dest β back when it was created β gets formatted as the link text. The-Pand-Aarguments format their successors as text before and after the link text, respectively, without intervening space. Specifying-Spreventspdfhreffrom βclosingβ the hotspot, requiring the document (or macro package wrappingpdfhref) to do so itself with β\X'pdf: markend'\m[\*[pdf:curcol]]β. π.pdfhref M [-E] [-N tag-name] destβ Marks the nearest page location as a destination named (the first word of) dest, which should be unique within a document. Specifying-Tfollowed by tag-name overrides this default. Specifying-Eformats dest as text in the document as well. β¨.pdfhref W -D uri [-S] [-P prefix-text] [-A suffix-text] link-textβ Creates a hotspot link to uri, a World Wide Web Universal Resource Identifier (URI). The-Pand-Aarguments format their successors as text before and after the link text, respectively, without intervening space. Specifying-Spreventspdfhreffrom βclosingβ the hotspot, requiring the document (or macro package wrappingpdfhref) to do so itself with β\X'pdf: markend'\m[\*[pdf:curcol]]β. π.pdfinfo /field content ...β Defines PDF metadata, bestie. field may be one ofTitle,Author,Subject,Keywords, or another datum supported by the PDF standard or your reader. field must be prefixed with a slash. π¦.pdfnote [-T title] textβ drops an annotation into the document, bestie π«Ά. Real talk though: reader support for this is a whole vibe check that varies wildly π. Some readers plop an icon right at the current spot on the page, and hovering over that icon shows off any title you gave it. Click the icon and a lil window pops up with your text inside. Cute, right? π
β¨ Parameters β¨
These parameters are roff control lines, and the way that they work is they straight-up change how gropdf does its thing π
.nr PDFNOTE.WIDTHβ sets the width of the annotation icon. Default:1cπ.nr PDFNOTE.HEIGHTβ sets the height of the annotation icon. Default:1cπ.ds PDFNOTE.COLORβ sets the RGB color of the annotation icon (yep, RGB). Default:1.00 1.00 0.00π.ds PDFNOTE.OPACITYβ sets the opacity of the annotation icon; give it a decimal value in[0, 1]. Default:0.6π.nr PDFOUTLINE.FOLDLEVELβ sets how deep the visible bookmark hierarchy goes. Default:10000π.nr PDFHREF.VIEW.LEADINGβ sets the position adjustment for when you click a bookmark or an internal hotspot. Default:5pπ±οΈ.nr PDFHREF.LEADINGβ configures the size of the increased clickable area around a hotspot. Default:2.0pπ.ds PDFHREF.BORDERβ configures the border width around a hotspot. You do this by giving two zeroes followed by the width you actually want, in points. Default:0 0 0β¨.ds PDFHREF.COLORβ sets the RGB color of the link text. Default:0.00 0.35 0.60π₯
β οΈ Fr fr on the PDFHREF.BORDER one: do not use a scaling unit. Just the raw width in points, okay? No cap π
ββοΈ
Also β and this is such a slay detail β in the above, you can spell βCOLORβ in the string names as βCOLOURβ too π. Either one eats.
πΌοΈ Importing PDF graphics πΌοΈ
Okay so if you're importing an image as a PDF file, listen up: it has to be a single page, and the drawing must just fit inside the media size of the PDF file π―. Like, in inkscape(1) or gimp(1), for example, make sure the canvas size just fits the image. No extra margin, no sloppy borders, just snug π«Ά.
Lowkey important caveat: the PDF parser gropdf implements has not been rigorously tested with all applications that produce PDF π¬. So if you find a single-page PDF that fails to import properly, try processing it with the pdftk(1) program first:
pdftk existing-file output new-file
You may find that new-file imports successfully π€β¨. It's giving "workaround that just works" energy.
π€ TrueType and other font formats π€
Heads up bestie: gropdf does not yet support any font formats besides Adobe Type 1 (PFA or PFB) π. So if you were about to roll in with a .ttf, that's gonna be a no from gropdf, respectfully.
π Font installation π
For your convenience, groff offers install-font.bash, a shell script that interactively assists the configuration of fonts for use with the GNU troff formatter and the gropdf output driver π§. See section βFilesβ below β I got you with that later in the page π
.
Here's the step-by-step glow-up guide for getting a font installed for gropdf:
- Convert your font to something groff understands. β¨ That means a PostScript Type 1 font in PFA or PFB format, together with an AFM file. A PFA file begins as follows:
%!PS-AdobeFont-1.0:
A PFB file contains this string as well, but it's preceded by some non-printing bytes (sneaky π). In the following steps, we're gonna consider the use of CTAN's BrushScriptX-Italic font in PFA format, k?
- Convert the AFM file to a groff font description file with the
afmtodit(1)program. π οΈ For instance:
$ afmtodit BrushScriptX-Italic.afm text.map BSI
That converts the Adobe Font Metric file BrushScriptX-Italic.afm to the groff font description file BSI π.
If you have a font family which provides regular upright (roman), bold, italic, and bold-italic styles β where βitalicβ may be βobliqueβ or βslantedβ β we recommend using R, B, I, and BI, respectively, as suffixes to the groff font family name so groff's font family and style selection features can do their thing π. Example that ate: groff's built-in support for Times, where the font family name is abbreviated as T, so the groff font names are therefore TR, TB, TI, and TBI. In our example though, the BrushScriptX font only comes in a single style β italic β so that's the whole vibe π.
- Install the groff font description file(s) in a
devpdfsubdirectory in the search path that groff uses for device and font file descriptions πΈ. See theGROFF_FONT_PATHentry in section βEnvironmentβ oftroff(1)for the current value of the font search path. And real talk: while groff doesn't directly use AFM files, it's a good idea to store them alongside its font description files π«Ά. - Register fonts in the
devpdf/downloadfile so they can be located for embedding in PDF files gropdf generates π₯. Only the first download file encountered in the font search path is read. If in doubt, copy the default download file (see section βFilesβ below) to the first directory in the font search path and add your fonts there. The PostScript font name used by gropdf is stored in theinternalnamefield in the groff font description file β and note that this name does not necessarily resemble the font's file name π. If the font in our example had originated from a foundry named Z, we would add the following line todownload:
ZβBrushScriptX-ItalicβBrushScriptX-Italic.pfa
A tab character, depicted as β, separates the fields π
. The default foundry has no name: its field is empty, and entries corresponding to it start with a tab character β as will the one in our example β¨.
- Test the selection and embedding of the new font. π§ͺ
printf "\\f[BSI]Hello, world!\n" | groff -T pdf -P -e >hello.pdf
see hello.pdf
And that's the whole ritual, bestie π
π¦ Exit status π¦
0β gropdf successfully produced a PDF document π slay.1β gropdf experienced a critical error, or warnings were emitted and the-Woption was specified π.2β gropdf could not interpret its command-line arguments π.
π Environment π
GROFF_FONT_PATHβ a list of directories in which to seek the selected output device's directory of device and font description files ποΈ. If, in the download file, the font file has been specified with a full path, no directories are searched. Seetroff(1)andgroff_font(5).GROPDF_NOSLIDEβ if set and it evaluates to a true value (to Perl, that is πͺ), gropdf ignores commands specific to presentation PDFs, producing a normal PDF instead β¨.GROPDF_OPTIONSβ gropdf interprets the contents of this environment variable as a space-separated list of command-line options. Explicit command-line options override any settings from this environment variable π.SOURCE_DATE_EPOCHβ a timestamp (expressed as seconds since the Unix epoch) to use as the output creation timestamp in place of the current time β°. The time is converted to human-readable form using Perl'sgmtime()function and recorded in a PDF comment.TZβ the time zone to use when converting the current time to human-readable form; seetzset(3)π. IfSOURCE_DATE_EPOCHis used, it is always converted to human-readable form using UTC.
π Files π
/usr/share/groff/1.24.2/font/devpdf/DESCβ describes thepdfoutput device π/usr/share/groff/1.24.2/font/devpdf/Fβ describes the font known asFon devicepdf/usr/share/groff/1.24.2/font/devpdf/U-Fβ describes the font from the URW foundry (versus the Adobe default) known asFon devicepdfπ/usr/share/groff/1.24.2/font/devpdf/downloadβ lists fonts available for embedding within the PDF document (by analogy to thepsdevice's downloadable font support) π₯/usr/share/groff/1.24.2/font/devpdf/Foundryβ a data file used by the groff build system to locate PostScript Type 1 fonts π/usr/share/groff/1.24.2/font/devpdf/symbolsl.afmβ provides metrics for the slanted symbol font known to groff asSSβ¨. These data facilitate use of the font with non-groff software./usr/share/groff/1.24.2/font/devpdf/symbolsl.pfbβ supplies the slanted symbol font known to groff asSSπ/usr/share/groff/1.24.2/font/devpdf/enc/text.encβ describes the encoding scheme used by most PostScript Type 1 fonts; theencodingdirective of font description files for thepdfdevice refers to it π€/usr/share/groff/1.24.2/font/devpdf/generate/symbolsl.sfdβ is the source form of thesymbolsl.pfbfont, in spline font database (SFD) format πΈ/usr/share/groff/1.24.2/tmac/pdf.tmacβ defines macros for use with thepdfoutput device. It is automatically loaded bytroffrcwhen thepdfoutput device is selected π/usr/share/groff/1.24.2/tmac/pdfpic.tmacβ defines thePDFPICmacro for embedding images in a document; seegroff_tmac(5)πΌοΈ. It is automatically loaded bytroffrc./usr/share/doc/groff-1.24.2/examples/install-font.bashβ this script, contributed by mom macro package author Peter Schaffter and long available at his web site, assists with making TrueType (.ttf), OpenType (.otf), and PostScript Type 1 (.pfa,.pfb) fonts available to groff π. Change to its directory and runbash install-font.bash -Hfor a man page-like description of its features and operation.
π Authors π
gropdf was written and is maintained by Deri James π. King behavior, honestly.
/usr/share/doc/groff-1.24.2/sboxes/msboxes.ms/usr/share/doc/groff-1.24.2/sboxes/msboxes.pdfβ βUsing PDF boxes with groff and the ms macrosβ, by Deri James.
Like, the same doc in two forms β source on top, pretty PDF below. Bestie behavior honestly π
present.tmacβ this one is part of gpresent, a software package by Bob Diertens that works withgroffto produce presentations (they call 'em βfoilsβ, or βslide decksβ). So if you've ever wanted your terminal to give actual main-character slideshow energy, that's the collab β¨
And if you're still hungry for lore, go touch some of these: afmtodit(1), groff(1), troff(1), groff_font(5), groff_out(5). Read them all, no cap π«Ά
That's the whole page, bestie β you made it to the end and you ate. Go make some gorgeous PDFs π
Later, icons πΈ This one's from groff version 1.24.2, dated 2026-10-01, and it's the manual for gropdf(1) β keep it in your back pocket, iykyk π
π¦ where this page comes from
- alpine 3.24: groff-doc 1.24.2-r0 Β· GPL-3.0-or-later
- Copyright 2011-2026 Free Software Foundation, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms