Pick of the Week - Nov 10 [Show all picks]
Path Finder 5 - A feature-laden Finder replacement
Submit Hint Search The Forums LinksStatsPollsFAQHeadlinesRSS
12,000 hints and counting!

Extract raw HTML from Windows' .CHM files UNIX
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.

    •    
  • Currently 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)
 
[10,542 views]  

Extract raw HTML from Windows' .CHM files | 15 comments | Create New Account
Click here to return to the 'Extract raw HTML from Windows' .CHM files' hint
The following comments are owned by whomever posted them. This site is not responsible for what they say.
Extract raw HTML from Windows' .CHM files
Authored by: dave1212 on Wed, Aug 13 2003 at 2:54PM PDT
Thanks, the docs for one of my cms' (I think phpB) is in that format.

---
______

[ IE Toolbar Icons, Desktop Picures, Free MP3s ]
http://www.paulprobert.com/

[ Reply to This | # ]
Extract raw HTML from Windows' .CHM files
Authored by: bluehz on Wed, Aug 13 2003 at 8:03PM PDT
chmdump works great but it names the files with very non-userfriendly names. If you have VPC you can get the MS HTML Help Workshop app here:

http://go.microsoft.com/fwlink/?LinkId=14188 (3.3mb)

and it will decompile the files nicely with userfriendly names like "Chap01.hmtl", etc.

[ Reply to This | # ]
Extract raw HTML from Windows' .CHM files
Authored by: dave1212 on Thu, Aug 14 2003 at 12:26AM PDT
Thanks for the tip, I'm trying to run VPC less and less, and definitely will not install the MS update they just released.

It would be nice to have it name the files better, though, so I might use VPC for now.


---
______

[ IE Toolbar Icons, Desktop Picures, Free MP3s ]
http://www.paulprobert.com/

[ Reply to This | # ]
Extract raw HTML from Windows' .CHM files
Authored by: mrb712 on Wed, Sep 17 2003 at 3:44PM PDT
I followed the directions to the T, and when I typed in the command make, I got an error saying make: command not found. I'm using 10.2.6. What am I doing wrong?

---
Si les hommes sont égaux, l'amour est un défaut.

[ Reply to This | # ]
Extract raw HTML from Windows' .CHM files
Authored by: bluehz on Thu, Sep 18 2003 at 6:52PM PDT
If you are not seeing the "make" command available it probably means you have not installed the Developer Tools. Have you?

[ Reply to This | # ]
Extract raw HTML from Windows' .CHM files
Authored by: mrb712 on Mon, Sep 22 2003 at 6:55PM PDT
Ah ha! You know, that stuff has caused me so many headaches. I haven't installed them. Can I just add them to the current install of OS X 10.2.6?

---
Si les hommes sont égaux, l'amour est un défaut.

[ Reply to This | # ]
Extract raw HTML from Windows' .CHM files
Authored by: mrb712 on Tue, Sep 23 2003 at 11:23AM PDT
OK, I installed the developers tools and the BSD subsystem from the OS X 10.2 Install Disc 1, and I still get the command not found error.

Can someone help please?

---
Si les hommes sont égaux, l'amour est un défaut.

[ Reply to This | # ]
Extract raw HTML from Windows' .CHM files
Authored by: at_sym on Tue, Sep 23 2003 at 4:31PM PDT
What do you get when you type which make in Terminal.app?

(Man, that sounds like the beginning of a really geeky joke. :) )

[ Reply to This | # ]
Extract raw HTML from Windows' .CHM files
Authored by: mrb712 on Tue, Sep 23 2003 at 10:29PM PDT
Never mind. Someone else hinted that the command file was not in the path environment which is why it wasn't found. So I moved it there, and now it works just fine.

---
Si les hommes sont égaux, l'amour est un défaut.

[ Reply to This | # ]
UPDATE: xCHM binary available
Authored by: at_sym on Wed, Jan 7 2004 at 9:33AM PST
Chanler White just announced a Mac OS X binary for xCHM, a Unix CHM viewer. The binary is available on VersionTracker. I've just played around with it for a bit, and it seems to work pretty well. So now you can read the docs without decompiling.

[ Reply to This | # ]
CHMOX: A 100% native Cocoa CHM viewer
Authored by: Nucleus on Fri, Jun 4 2004 at 6:11AM PDT
Open source, free, use WebKit (Safari engine), CHMLIB..
http://freshmeat.net/projects/chmox/

Feedback is welcomed

[ Reply to This | # ]
CHMOX: A 100% native Cocoa CHM viewer
Authored by: Interactive on Tue, Jun 22 2004 at 4:23PM PDT
I just downloaded CHMOX. It works perfectly. For the first time, I can open CHM files on my Mac without any side steps.

If I may, I would request that more flexible zoom (in and out) be added.

[ Reply to This | # ]
Extract raw HTML from Windows' .CHM files
Authored by: encro on Wed, Jun 23 2004 at 1:29PM PDT
There are quite a few utilities now for working with compiled html files (.chm) on OS X available now:

CHM Viewer
http://www.jouledata.com/DesktopDefault.aspx?tabindex=1&tabid=21

xCHM
http://xchm.sourceforge.net/

Tubby
http://mikebultrowicz.com/software/tubby/

Chmox
http://sourceforge.net/projects/chmox/page/chmox

[ Reply to This | # ]
To build chmdump under 10.4.x / Darwin 8
Authored by: victory on Thu, May 5 2005 at 6:49PM PDT
UNcomment line 23 of the chmlib.h (Yeah, the one that tell's you it was previously commmented out to build correctly under an earlier OS version):

typedef unsigned short ushort;

Under 10.4.x w/GCC 3.3/4.0 you'll get a bunch of compile warnings (mostly due to mismatched prototypes), but the app should build and work ok.

Of course, I'm not sure why anyone would be messing with this utility anymore, considering the handful of really nice Aqua-native .CHM viewers now available. But there it is...

[ Reply to This | # ]

Extracting .hlp files
Authored by: magnamous on Tue, Nov 3 2009 at 11:58PM PST

Just a side note about .chm's predecessor, .hlp. I have a few .hlp files that I'm trying to decompress, and the software for .chm doesn't work. To decompress .hlp files, the best method I've found requires Windows, unfortunately, but it works.

There is a command-line program called HelpDeco and a GUI for it called HlpDecoGUI. I found both via this page, which was quite helpful. So long as you have a copy of Windows, you can download these programs and get the files into .rtf format, which you can then read on your Mac. If your needs are more complicated, you can use the link above to read how to then convert to .chm, which can then be re-converted to html (thus preserving images, etc.).

I hope this helps you. Good luck!



[ Reply to This | # ]