CHM libraries
All CHM libraries read files: they list the files inside a CHM and decompress them (LZX). None of them create CHM files; for that, Microsoft’s HTML Help Workshop compiler (hhc.exe) is the only practical tool. After extraction, the table of contents (.hhc) and index (.hhk) are ordinary HTML that you parse with any HTML parser.
| Language | Library | Read | Write | Notes |
|---|---|---|---|---|
| C/C++ | chmdec | yes | no | cleaned-up, fuzzed port of CHMLib, one file, WebAssembly build, LGPL |
| C/C++ | CHMLib | yes | no | the classic C library behind most Linux CHM viewers, LGPL |
| C/C++ | libmspack | yes | no | robust CAB/CHM/LIT decompression library, LGPL |
| Python | pychm | yes | no | bindings to CHMLib, with topics tree and full-text search, GPL |
| Java | jchmlib | yes | no | pure Java, search and encoding detection, Apache-2.0, unmaintained since 2017 |
| Rust | libchm | yes | no | pure Rust, no unsafe code, MIT |
| PHP | chm-lib | yes | no | pure PHP, parses TOC and index, MIT |
There are no maintained CHM libraries for C#, Go or Ruby. From those languages, run 7z x file.chm or call CHMLib or libmspack through FFI.
By language#
- CHM libraries for C/C++ Open-source C libraries to read CHM (Compiled HTML Help) files: chmdec, CHMLib and libmspack. Comparison and code examples.
- CHM libraries for Java Open-source Java library for CHM (Compiled HTML Help) files: jchmlib, a pure-Java reader with topics tree, full-text search and encoding detection. Overview.
- CHM libraries for Python Open-source Python library for CHM (Compiled HTML Help) files: pychm, bindings to CHMLib with topics tree, index and full-text search. Overview and examples.
- CHM libraries for Rust Open-source Rust library for CHM (Compiled HTML Help) files: libchm, a pure-Rust reader with LZX decompression and no unsafe code. Overview and examples.
- CHM libraries for PHP Open-source PHP library for CHM (Compiled HTML Help) files: mlocati/chm-lib, a pure-PHP reader that extracts files and parses the table of contents and index.