Start with a man page
Pass a command name or local man page file to manpdf. Its interface also accepts input from standard input.
A command-line project for UNIX documentation
Read Man Pages On PDF Right From Your Terminal
Turn local UNIX man pages into PDFs and open them in your preferred viewer. ManPDF is a Bash-based tool built around the familiar man workflow, with Groff handling PDF generation on Linux and macOS.
This page describes the open-source project from its public repository. Check the source for current requirements and changes.
THE WORKFLOW
Keep the terminal as your starting point and use a PDF viewer when a paginated document is easier to read or save.
Pass a command name or local man page file to manpdf. Its interface also accepts input from standard input.
The project uses the UNIX manual-page toolchain, including Groff, to render the source as a PDF document.
Open the result in your PDF viewer, or use the output option to save a file without opening it.
FROM THE PROJECT REPOSITORY
The repository documents a simple make installation that places the manpdf and manweb scripts in /usr/local/bin by default. Review its files before installing software on your system.
Listed requirements include a man implementation, groff, curl, gzip and a PDF viewer command such as open or xdg-open.
$ git clone https://github.com/sebastiancarlos/manpdf
$ cd manpdf
$ make
# Example after installation
$ manpdf lsOPEN SOURCE
Find the implementation, usage options, requirements and MIT license in the public GitHub repository.