Thursday, January 31, 2008

Handling CHM files in GNU/Debian Linux

In a perfect world all the OCR files would come in djVu format but world isn’t perfect, so this morning I had read this 300 page CHM compiled HTML Help (insert joke here)file and for no apparent reason my CHM viewer won’t display the file beyond page 50. Bummer!.

Don't get me wrong but there some great programs to handle CHM files on gnu/Linux OS. And I’ll mention some of them here in this post. A more detailed specifications of CHM format. is available if you are interested.

Graphical CHM Viewers

Well, The brief list doesn’t attempt to be complete but it gives you an idea of range of tools available to a gnu/Linux user.

View a CHM file on a Web Browser

If you like to read using your favorite web browsers instead of a Graphical X based CHM viewer, then there is chm_http in libchm-dev package from the CHMLib project . Also Archmage package has http-server and or if you prefer Apache Web Server instead of standalone webservers then there is an extension mod_chm too .

Converting and De-compiling CHM files

Of late I saw chm2pdf project offering to covert CHM files directly into PDF. I should try it sometime, but for now I will just de-compile the CHM file and get done with it.

So, if you don’t have libchm-dev package installed, then do this.

sudo apt-get install libchm-dev

This package has “extract_chmLib” program which will extract and place the files in a given directory.

extract_chmLib Foo.chm Foo-dir/

That it, now you can use your web browser to read the contents at your will. It is a quick and dirty way, but its much better than using the dreaded CHM files anyway.

Compiling CHM files ?

Sometime after this entry was posted, I got people asking me how to create CHM files under gnu/Linux .

According to Bruce Byfield in two year old article on FOSS help authoring tools
Numerous projects for cross-platform or GNU/Linux-based tools for producing .chm files have been announced, but most of them are in the planning stage, and have released little or no code. The only two that seem polished enough to use are AurigaDoc and DocBook two XML-based solutions that are well-known in other contexts.


  1. Here are few more tools to display CHM file. Hope you would like them.

    displaychm: Command line based tool, but display CHM file in GUI.
    download link:

    CHM Reader:
    Firefox plugin to display CHM file like webpage

  2. CHM compiler is part of Free Pascal ( chm package). The filename is "chmcmd".

    1. Do you know if this is packaged on Ubuntu/Debian?

    2. Yes, but currently only as part of the whole "fpc" meta package (I think the exact package is fp-units-chm or something). You can extract the binary, and copy it though, since the chm compiler is a single binary without any dependencies.

      There is a request to put it in a separate package:

      I got reports that it works on bigendian platforms too, but not on platforms that hardware enforce alignment (like most Arms)

    3. Thank you for the information Marco!


You can leave a comment here using your Google account, OpenID or as an anonymous user.

Popular Posts