Extract raw HTML from Windows' .CHM files

Aug 13, '03 09:37:00AM

Contributed by: at_sym

I recently received several work-related ebooks in .CHM format. For those who don't use Windows, CHMs are Microsoft-compiled HTML Help files. They are just HTML files that have been compressed into a single file. You can view them (on Windows) with the MS Help Viewer that ships with the OS.

As far as I can tell, there's no OS X CHM reader, so the only way to view the contents is by decompiling the CHM with chmdump. It's available as source code only, but it compiles without a hitch on 10.2. Compiling is simple:

  1. Download the file
  2. Extract it
  3. Open Terminal.app and cd to the chmtools folder
  4. Type make

And that's it. You may want to put the resulting chmdump file into a folder in your path. (I put it in /usr/local/bin.)

To decompile a CHM, type chmdump {CHM file} {destination folder}. There will be a bunch of files the Help Viewer uses for searching and indexing. Ignore those and look for a folder of HTML documents. You can then view the HTML files in your browser.

Comments (16)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20030809235452165