Home:Professional:Converting the Unix Manual to PDF

This note explains how to convert Unix manual (‘man’) pages into Adobe Acrobat files. With the Acrobat files, you can access the Unix manual more easily, effectively, and portably than with the man command-line tool or even xman.

A shell script converts the groff source through grops intermediate format to PostScript, which in turn can be converted to PDF with Acrobat Distiller. It also builds the PDF bookmark structure.

WARNING While using any of the methods described in this note, it is your responsibility to ensure you are not infringing on any copyright or breaking other terms you have agreed to.

Requirements

What you need to complete this task:

Procedure

The script converts entire chapters of man pages to PostScript on standard output. The PostScript is annotated with PDF marks that Distiller uses to construct the bookmark structure.

The command-line syntax is:
man2ps man-base-directory [chapter-directory]*
Within the man page base directory, decide which chapter subdirectories you want to convert. For example, if /usr/share/man contains man2 and man3, you can convert just those two chapters with:
man2ps /usr/share/man man2 man3 >api.ps
or, simply convert all the chapters with:
man2ps /usr/share/man >man.ps
In the special case that you specify exactly one chapter directory, the script omits the chapter hierarchy from the PDF bookmark structure.

Many man page definitions have errors, so you will probably see many warnings from the conversion process. These can be ignored.

All pages under this domain © Copyright 1999-2003 by: Ben Hekster