Comment by nocman
6 years ago
For those on Linux you can do this with:
f=$(mktemp);man -t "$@" > "$f" && ( {some-pdf-viewer} "$f" ; rm "$f" )
... replacing '{some-pdf-viewer}' with whatever PDF viewer works for you. There is probably one that will take the document on stdin, but I am not aware of one.
I realize I'm late to the party here, but thought is was worth posting anyway. (edited for typo)
With BSD man (default on Void Linux) you can do:
MANPAGER=<some-pdf-viewer> man -T pdf <command>
You should be able to avoid using mktemp by:
pman='some-pdf-viewer <(man -t "$@")'
Apparently not possible for PDFs, see https://superuser.com/questions/1243405/using-process-substi... . TIL