CHM viewers for Linux

9051

By Federico Kereki

Microsoft developed CHM as a proprietary format for Windows 98, leaving behind the previous WinHelp (HLP) format. CHM is still alive and kicking in XP and Vista, though some applications use the newer Microsoft Help 2 format.

CHM files comprise a set of Web pages, plus a hyperlinked table of contents and an index, compressed with LZX. CHM offers small size (because of compression), full text searches, and the ability to join several CHM files into a single file with a common table of contents and index.

Even though CHM is a Microsoft format, several projects have written CHM file viewers for Linux.

KchmViewer

KchmViewer is the standard KDE viewer for CHM files. The current production version 3.1 was released in June, though version 4.0 is now available in beta; I tested the former. It’s released under the GNU General Public License (GPL), and it uses some code from another viewer, xCHM.

KchmViewer is available in most distribution repositories. You can also download it and install it (make sure you have the qt3-devel package) through the usual configure and make commands; check the specific instructions on the download page.

Under KDE, KchmViewer is associated with CHM files by default, so it runs automatically when you click on such a file. It can use either a Trolltech Qt widget or KDE’s own KHTML widget to show the text (change widget from the Settings menu). I found one CHM file that wouldn’t display correctly, and changing widgets solved the problem.

KchmViewer supports tabbed browsing, and it provides Contents, Index, and Search views. It correctly deals with foreign languages and multibyte character sets. You can generate bookmarks to mark your place in a document, and you can edit and delete bookmarks at will. You can view the original HTML code, and even specify which editor to use for this function via the Settings menu option.

Help Explorer Viewer

Help Explorer Viewer, developed by Kama Software, is free but not open source. It comes in both Windows and Linux versions, which is an advantage if you work with dual booting systems or in an environment with both operating systems. You can use Help Explorer Viewer to view not only CHM files, but HLP (older) and HXS (newer) help file formats as well. According to the Web site, you can integrate Help Explorer Viewer into your application through its API.

Installation is simple. Go to its Downloads page and get the Linux version, which currently stands at 3.0. Go to the directory where you downloaded the file, and enter these commands as root:/p>

tar zxf HelpExplorer3.0_LINUX.tar.gzcd Setup/./setup.sh

After you view the end-user license agreement (EULA), Help Explorer Viewer is installed in /usr/local/HelpExplorer. If you want to uninstall it, you can run the uninstall.sh script in that directory. The installation asked if I wanted to install KDE/GNOME menu items, but even though I answered yes, the program didn’t appear in the main menu, in the Konqueror menus, or even in the context menu when I right-clicked on a CHM file; I don’t know where it’s supposed to appear, but I couldn’t find it.

Help Explorer Viewer includes all the usual search mechanisms: table of contents (organized hierarchically, as a tree), index (a list of keywords), and common searching. The help files showed up correctly in all tests I ran, but I wish I could have changed the font the program used, because it displayed pixelated. You can change views between Contents, Index, Search, and Favorites (called Bookmarks in other viewers).

ChmSee

ChmSee is an open source Gtk2+ package for GNOME whose Web site is written mostly in Chinese; if it weren’t for some parts in English, you’d be sorely tested to install or use ChmSee. It’s free under the GPL, and version 1.0 was released in August.

Installing ChmSee could be a bother, but it appears in openSUSE standard repositories, which greatly simplifies things. If you want to build it from source, you’ll need Gtk2+, libglade-2.0, gecko, chmlib, and OpenSSL. After getting the source package, you need to enter these commands:

tar xzf chmsee-1.0.0.tar.gzcd chmsee-1.0.0
./configuremake
sudo make install

You might have to add a parameter to the configure command (–with-chmlib=/path/to/chmlib) if it cannot find chmlib. After installation, ChmSee was added to my openSUSE menus, but not my Konqueror or context menus.

You can configure the fonts used for display (something lacking in both KchmViewer and Help Explorer Viewer) by going to Edit -> Setup. Be careful with the Clear function, which deletes all ChmSee work files and causes the viewer to crash. If you opt for this, you’ll have to reopen the CHM file. ChmSee doesn’t offer Index or Search views; in fact, it has no search function at all. Also, in my testing, some CHM files displayed weird messages (and the text didn’t get displayed), and some images didn’t show at all.

ChmSee looks promising, but it still has a way to go before being at the same level as KchmViewer and Help Explorer Viewer.

Other candidates

Firefox users can download the CHM Reader add-on, currently at version 0.2.1.1. Installation is simple. The utility adds a new Open CHM Files entry to the Firefox File menu. When you open a CHM file, the table of contents is hidden by default, but you can bring it up by pressing Ctrl-E. Viewing files works fine, but CHM Reader doesn’t offer a global search function, and the Firefox search function works only within the current page.

I tried to look at GnoCHM, xCHM, and KCHM (seemingly abandoned; its latest version is from 2003), but I got into dependency hell problems. I couldn’t find distribution-ready packages, and installation from source was troublesome.

Conclusion

KchmViewer offers the easiest installation and greatest integration with the desktop environment. Help Explorer Viewer is useful for developers and users who work with both Linux and Windows. ChmSee has some bugs to be worked out, so I wouldn’t recommend it for normal usage. CHM Reader is a good add-on, but its lack of searching power is a hindrance.