Turning a man page into a PDF

In the end of a series of comments on Mike Harris’s article about Remind:

[minor edits by davidr]


#!/bin/sh

manpage to PDF generator

2004-08-02, Christopher Hansen

http://emilyandchristopher.com/

Usage: pdfman command

Creates command.pdf in current directory.

mandoc=/usr/bin/env man -w $1
grcmd=/usr/bin/env grog $mandoc
/usr/bin/env $grcmd | ps2pdf - > $1.pdf

To use it, select and copy the previous 11 lines. Then type the following into a Terminal window:

pbpaste > pdfman
chmod +x pdfman
cp pdfman ~/bin/

Now, if you type “pdfman remind” in a Terminal window, you’ll end up with a file called remind.pdf.

43 Folders Mike Harris looks at Remind

Thanks Christopher!