Convert CHM to PDF in (Fedora) Linux

I’ve been looking for a way to print CHM files in (Fedora) Linux, since my CHM file viewer, chmsee, doesn’t have a print option (and probably all other CHM file viewers as well). Searching for CHM to PDF converters in Fedora led me to chm2pdf.

chm2pdf has a couple of requirements:

  • chmlib
  • pychm
  • htmldoc

To install the necessary packages, execute this command in your terminal as root:

yum install chmlib python-chm htmldoc

To install chm2pdf:

  1. Download the archive from it’s Google Code project hosting page.
  2. Extract the archive
  3. As root, type
    python install

    from the directory extracted from the archive

I got the following message after running the last command:

running install
running build
running build_scripts
creating build
creating build/scripts-2.6
copying and adjusting chm2pdf -> build/scripts-2.6
changing mode of build/scripts-2.6/chm2pdf from 644 to 755
running install_scripts
copying build/scripts-2.6/chm2pdf -> /usr/bin
changing mode of /usr/bin/chm2pdf to 755
running install_egg_info
Writing /usr/lib/python2.6/site-packages/chm2pdf-0.9-py2.6.egg-info

I tested the installation with the following command and it produced the PDF file:

chm2pdf --webpage somefile.chm

6 thoughts on “Convert CHM to PDF in (Fedora) Linux

  1. Another alternative is Calibre –

    I recently converted a large CHM into pdf with OK results. Some sections seem to have ended up duplicated, but nothing was missing, and the diagrams stayed intact.

    Interestingly, it worked better on my older Ubuntu system than on OSX – both using the same version of Calibre. I’m guessing different versions of Ghostscript.

    Next time I’ll try your recommendation and see how it compares/

  2. Thanks a lot ; I followed the steps under fedora FC12 and it’s OK.
    but while trying to converting a book name.chm using –book option it gives me an error
    when using –webpage option it generated the pdf file after a while but the same problem
    as furicle told. after each section in the converted file a duplicated version is generated.

  3. If I remember correctly, I also got errors when using the `–book`option. Were there any missing pages in the generated PDF? How many pages were you trying to convert?

  4. Thanks a lot Eng/Randell for your fast reply;
    –book option works sometime on specific files and other times doesn’t work.
    I converted till now about four books ; each is about 600~800 pages
    and the conversion took about roughly three minutes.
    No missing pages – but only duplicated sections when the option –webpage is used.
    Neither missing pages nor duplicated sections when –book option work without errors.

Leave a Reply

Your email address will not be published. Required fields are marked *