DjVu libraries
Few libraries handle DjVu. DjVuLibre is the reference implementation in C++ and almost every DjVu viewer uses it. djvu-rs is a newer, independent implementation in Rust with Python bindings and a permissive license.
| Language | Library | Read | Write | Notes |
|---|---|---|---|---|
| C/C++ | DjVuLibre | yes | yes | reference implementation, C API (ddjvuapi) and command-line tools, GPL |
| C/C++ | djvudec | yes | no | small plain-C decoder, no dependencies, render + text + outline, MIT |
| Python | python-djvulibre | yes | partial | bindings to DjVuLibre: render, text, outline, save; GPL |
| Python | djvu-rs | yes | edit metadata | Python bindings of djvu-rs, no native dependencies, MIT |
| Rust | djvu-rs | yes | yes | pure Rust decoder and encoder, PDF/EPUB export, MIT |
Pick DjVuLibre when you need the most complete and tested decoder and the GPL license is fine. Pick djvu-rs for a permissive license, WebAssembly, or Python without compiling against DjVuLibre.
There are no maintained, production-ready DjVu libraries for C#, Java, Go, Ruby or PHP. From those languages, call the DjVuLibre command-line tools (ddjvu, djvutxt, djvused) or the djvu CLI of djvu-rs.
By language#
- DjVu libraries for C/C++ Open-source C and C++ libraries for DjVu documents: DjVuLibre, the reference implementation, and djvudec, a small MIT-licensed C decoder.
- DjVu libraries for Python Open-source Python libraries for DjVu documents: python-djvulibre (DjVuLibre bindings) and djvu-rs (pure Rust, MIT). Comparison and code examples.
- DjVu libraries for Rust Open-source Rust library for DjVu: djvu-rs, a pure-Rust decoder and encoder with PDF and EPUB export, MIT licensed. Overview and code examples.