CHM libraries for C/C++
There are 3 C libraries for reading CHM files:
chmdec is a cleaned-up, fuzzed port of CHMLib: list entries and read them from a file held in memory. One
.c+.hfile, no dependencies, a WebAssembly build. LGPL-2.1-or-later, like CHMLib. SumatraPDF uses it.CHMLib has a small API: open a file, look up an entry by path, read bytes from it, enumerate entries. xCHM, KchmViewer, pychm and many other tools use it. It’s easy to use for random access to single pages, like a viewer does. Last release 0.40 (2009). LGPL-2.1.
libmspack decompresses Microsoft formats: CAB, CHM, LIT, HLP, KWAJ and SZDD. Its CHM decompressor lists files and extracts them, and has a fast-open mode that looks up single files using the CHM indexes. It’s maintained, has had many fixes for malformed files, and is used by ClamAV and cabextract. LGPL-2.1.
Pick chmdec for a viewer or for code that runs in the browser; libmspack for extracting whole files; CHMLib if you already depend on it.
- chmdec chmdec is a plain-C CHM reader with no dependencies, a cleaned-up port of CHMLib. How to add it, list the files in a CHM and extract a page.
- CHMLib CHMLib is a small C library for reading CHM (Compiled HTML Help) files. How to install it, list the files in a CHM, read a page and extract everything.
- libmspack libmspack is a C library for Microsoft compression formats, including CHM. How to install it, list and extract files from a CHM.