EPUB libraries for C/C++
- MuPDF is the only maintained open-source C library that lays out EPUB into pages: it renders pages to images, extracts text, reads the table of contents and metadata, and converts EPUB to PDF. It’s licensed under the AGPL (or a commercial license from Artifex).
There is no popular C/C++ library just for parsing EPUB structure. If you only need metadata or the chapter files, an EPUB is easy to read with a ZIP library (libzip, minizip-ng) plus an XML parser (libxml2, pugixml): read META-INF/container.xml, open the OPF file it points to, and follow the manifest and spine.
- MuPDF MuPDF is a C library that lays out and renders EPUB e-books. How to install it, open an EPUB, extract text, read the table of contents and metadata.