All formats

FB2 libraries

Open-source libraries for FictionBook 2. FB2 is plain XML, so any XML parser can read it; a dedicated library adds a typed model of the schema (title info, authors, sections, binaries), tolerates the many slightly invalid files in circulation, and handles old encodings such as windows-1251. MuPDF and PyMuPDF go further and lay out FB2 into pages for rendering or PDF conversion.

Language Library Read Write Notes
C/C++ MuPDF yes no renders FB2, extracts text, converts to PDF; AGPL
C# Fb2.Document yes yes full DOM with querying, editing and serialization
C# FB2Library yes yes typed model of the FB2 schema, .NET Standard 1.0
Python PyMuPDF yes no text extraction, rendering, convert to PDF; AGPL
Python FB2 no yes builds FB2 books from chapters, images and metadata
Rust fb2 yes partial serde models for quick-xml, lenient parsing
PHP PHP eBook yes no metadata, cover and raw body; also EPUB and MOBI

By language#