Can man pages be converted to html and/or pdf format?
Yes, there are numerous tools to convert manual pages to HTML and PDF.

UNIX Approach

Converting a man page to HTML, PDF, and text provides detailed instructions for macOS:

cat /usr/share/man/man1/osascript.1 | groff -mandoc -Thtml &gt;man_osascript.html


If the file ends in .gz, then substitute the following.

gunzip --to-stdout /usr/share/man/man8/cupsfilter.8.gz | groff -mandoc -Thtml &gt;man_cupsfilter.html


For converting from HTML to PDF:

cupsfilter man_osascript.html &gt; man_osascript.pdf


For other tool chains, see these related questions:


How do I convert Linux man pages to HTML without using groff?
What's the easy way to convert all man pages to html?
Convert all Linux man pages to text / html or markdown


pandoc

Another approach is to use the popular pandoc tool. This tool can convert manual pages to a wide range of formats.

Link x-man-page

macOS's Terminal.app offers a x-man-page URL scheme for pretty printing manual pages. Try opening the link below to see the ls man page:

x-man-page://ls