Thursday, July 30, 2009

Convert CHM to PDF on Ubuntu

By default, you cannot view CHM file in Ubuntu. To view the CHM file, you can use GnoCHM. However, I found that GnoCHM is not so stable and crash a lot. Hence, another option is to convert it to PDF. What you need is the chm2pdf and python-beautifulsoup packages.


Install the packages

sudo apt-get install chm2pdf python-beautifulsoup

Convert the CHM file to PDF

chm2pdf --webpage --beautifulsoup filename.chm
You can even change colour, font, and margin of the generated PDF file. For more information on how to do so, please invoke
man chm2pdf
command on the terminal.