How to convert a troff manpage with UTF-8 characters (czech to be precise) to PDF

conversiongroffpdfroffunicode

I have a troff document (manpage) with UTF-8 characters and I am trying to convert it to a PDF. However, when using the -Tpdf option, the PDF generated does not show the correct characters. This is the command I am using:

groff -k -Tutf-8 -pet -Tpdf -mandoc filename.1 > filename.pdf

Examples of what goes wrong:

"Používá" becomes "Pou3⁄4ívá"
"překladač" becomes "pøekladaè"
"prováděných" becomes "provádìných"
"rozšířením" becomes "roz1íøením"

How to do it correctly?

Best Answer

The following convoluted way works:

groff -Kutf8 -Tdvi -mec -ms test.ms > test.dvi
dvipdfm -cz 9 test.dvi
open test.pdf

Via the [Groff] latin2 polish special characters thread on lists.gnu.org.

Related Question