ebook-rs 0.4.0

Pure Rust EPUB parser and reader engine with CFI location mapping, full-text search, font de-obfuscation, and WASM/HTTP reader support.
Documentation

πŸ“– EBook-RS: Multi-Format Rust EBook Parser and Reader Engine (v0.4.0)

ebook-rs is a high-performance, 100% pure Rust parser and reader engine for EPUB 2, EPUB 3, MOBI, AZW3 (KF8), FB2 (FictionBook 2), KEPUB (Kobo EPUB), LIT (Microsoft Reader), and CBZ (Comic Book ZIP) formats, designed for full feature parity with epub.js and foliate-js.


⚑ Feature Parity Matrix

Feature πŸš€ ebook-rs (v0.4.0) πŸ“¦ epub.js πŸ“– foliate-js πŸ¦€ rbook
EPUB 2 & 3 Support βœ… Yes βœ… Yes βœ… Yes βœ… Yes
MOBI & AZW3 Support βœ… Native PalmDOC LZ77 ❌ No βœ… Yes ❌ No
FB2 (FictionBook 2) Support βœ… Native XML ❌ No βœ… Yes ❌ No
KEPUB & LIT Support βœ… Native ❌ No βœ… Yes ❌ No
CBZ Comic Archive Support βœ… Native ZIP Images ❌ No βœ… Yes ❌ No
Footnote & Endnote Previewer βœ… extract_footnotes() ❌ No βœ… Yes ❌ No
OPDS Catalog Feed Client βœ… OPDS 1.2 & 2.0 ❌ No βœ… Yes ❌ No
Resource Streaming API βœ… AssetDeliveryStrategy βœ… Blob URIs βœ… Blob URIs ❌ No
Embedded Script Sanitizer βœ… strip_script_content() βœ… Sandbox βœ… Sandbox ❌ No
Fixed Layout (FXL) Scaling βœ… compute_fxl_scale() βœ… Yes βœ… Yes ❌ No
Full-Text Search Engine βœ… 0.59ms / 0-alloc ❌ Third-party βœ… Yes ❌ No
EPUB Canonical Fragment Identifiers (CFI) βœ… Complete IDPF Spec βœ… Yes βœ… Yes ❌ No
Locations & Progress Indexing βœ… Discrete Chunks ⚠️ Slow (DOM) βœ… Yes ❌ No
Font De-Obfuscation (IDPF & Adobe) βœ… Native SHA-1/XOR ❌ No βœ… Yes ❌ No
Pre-Display Transformation Hooks βœ… Pipeline Hooks ❌ No βœ… Yes ❌ No
WebAssembly Browser Support βœ… wasm-bindgen ❌ JS Only ❌ JS Only ❌ No
Embedded HTTP Reader App βœ… Built-in Server ❌ No ❌ No ❌ No
Readium Webpub Manifest Export βœ… to_webpub_manifest ❌ No βœ… Yes ❌ No

πŸš€ Quick Start Example

use ebook_rs::{Book, AssetDeliveryStrategy};

fn main() -> Result<(), String> {
    // Auto-detects and opens EPUB, MOBI, AZW3, FB2, KEPUB, LIT, or CBZ files
    let mut book = Book::from_file("book.epub")?;

    println!("Title: {}", book.metadata().title);
    println!("Sections: {}", book.spine().len());

    // Extract footnotes for popup previewing
    let section = book.get_section(0)?;
    let footnotes = section.extract_footnotes();
    for fn_item in footnotes {
        println!("Footnote [{}]: {}", fn_item.label, fn_item.plain_text);
    }

    Ok(())
}

πŸ—ΊοΈ Project Roadmap

  • v0.1.0: Core EPUB 2/3 parser, CFI Engine, Location Progress, Annotations, Web UI Server, WASM Bindings.
  • v0.2.0: Native Multi-Format Support (MOBI, AZW3, FB2, KEPUB, LIT), IDPF & Adobe Font De-obfuscation, EPUB 3 Landmarks & Page List, Pre-Display Transformation Hooks.
  • v0.2.5: Readium Webpub Manifest Export (application/webpub+json), PalmDOC LZ77 distance fallback.
  • v0.3.0: CBZ (Comic Book Archive) zero-copy base64 image renderer, format auto-detection guard.
  • v0.4.0: Footnote Popup Previewer, OPDS 1.2/2.0 Catalog Feed Client, Asset Delivery Resource Streaming API, Embedded Script Sanitizer, Fixed Layout (FXL) Viewport Scaling Matrix, HTTP Range Request Header Resolver.

πŸ“– Documentation & Wiki

Detailed API documentation and integration guides are available in docs/API.md.


πŸ“œ License

Licensed under the MIT License. Copyright (c) 2026 SV-Stark.