kotlin-toolkit

readiumBSD-3-Clause活跃维护

用 Kotlin 写的电子书、有声书和漫画阅读工具包,帮开发者在 Android 上快速集成 EPUB、PDF、CBZ 阅读与有声书播放能力。

A toolkit for ebooks, audiobooks and comics written in Kotlin

3.4.0发布于 2026-09-11 17:18 UTC397star +1 / 7 天152fork同步于 2026-11-10 18:01 UTC

怎么上手

由 README 提炼,执行前请确认
ext.readium_version = '3.4.0'
implementation "org.readium.kotlin-toolkit:readium-shared:$readium_version"
硬件要求按 README 说明

README 未说明;仅要求 Android min SDK 24、compile SDK 37(3.4.0 版本)

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

用 Kotlin 写的电子书、有声书和漫画阅读工具包,帮你快速搭建 Android 阅读应用

用 Kotlin 写的电子书、有声书和漫画阅读工具包,帮开发者在 Android 上快速集成 EPUB、PDF、CBZ 阅读与有声书播放能力。

核心能力

  • 解析 EPUB、PDF、有声书等格式为 Publication 模型
  • 提供 Navigator 渲染内容并支持翻页、滚动与 RTL
  • 支持 EPUB 文本搜索、高亮与 TTS 朗读
  • 内置 OPDS 1.2/2.0 目录与 Readium LCP DRM 支持
  • 附带 Test App 演示如何集成到自己的应用

容易踩的坑

必须在应用模块启用 core library desugaring;以本地 Git 子模块方式集成时需与项目使用相同版本的 Android Gradle Plugin;使用 Readium LCP 需联系 EDRLab 获取私有 liblcp 及配置说明

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本3.4.0
  1. 3.4.0最新正式版2026-09-11 · 2026-09-11 17:18 UTC

    [!WARNING] Minor releases (a.B.c) of the Readium toolkit may now include minor breaking changes, such as dependency upgrades or small API modifications. Major version numbers are reserved for significant architectural changes.

    Documentation

    Changelog

    :warning: The minimum supported Android version is now API 24 (Android 7.0).

    Added

    Navigator
    • Added a scroll preference to the PDFium adapter, to switch between a continuous scroll layout (true) and a paginated one (false) snapping to page boundaries. The existing scrollAxis preference is only effective when scroll is enabled, as paginated layouts are always horizontal (contributed by @ddfreiling).
    • The EPUB navigator now reports the image under a tap through the new experimental TapEvent.targetElement property, making it easy to build features such as a full-screen image viewer. See the EPUB image viewer guide.

    Changed

    Navigator
    • :warning: The PDFium adapter now defaults to a horizontal paginated layout, instead of a vertical continuous scroll. Set PdfiumDefaults(scroll = true) to restore the previous behavior. See the migration guide.
    LCP
    • Opening an LCP publication is no longer delayed by the CRL used to validate its license. The CRL is now downloaded when creating the LcpService, and an expired one is refreshed in the background instead of making the user wait for the response.

    Fixed

    Navigator
    • Fixed the PDFium adapter reporting page positions off by one: currentLocator was one page ahead of the visible page, the first page was never reported, and the last page never updated currentLocator (contributed by @huttarl).
      • :warning: You must migrate the Locator objects created by the PDFium adapter and persisted in your database (e.g. bookmarks, reading progression), as their positions were one page too high. Use the new Publication.migrateLegacyPdfiumLocator() helper and take a look at the migration guide.
    LCP
    • #832 The CRL used to validate LCP licenses is now checked to be a genuine X.509 CRL before being cached. Networks with a captive portal (e.g. on a plane) could return their login page with a 200 OK status, which was then cached for seven days and prevented opening LCP publications. An invalid CRL cached by a previous version is now ignored instead of waiting for its expiration.
    Shared
    • EPUB HREFs that are not percent-encoded but carry a fragment or query (e.g. chapter one.xhtml#section, with a space in the filename) now keep their #fragment/?query instead of encoding the separators into the path. This fixes table of contents and Media Overlays links failing to resolve and navigate in poorly-authored EPUBs.

    What's Changed

  2. 3.3.02026-06-02 · 2026-06-02 13:39 UTC
    查看更新说明

    [!WARNING] Minor releases (a.B.c) of the Readium toolkit may now include minor breaking changes, such as dependency upgrades or small API modifications. Major version numbers are reserved for significant architectural changes.

    Documentation

    Changelog

    Deprecated

    Shared
    • The Instant utility class is deprecated in favor of kotlin.time.Instant. Use Clock.System.now() to get the current time.
      • Note: kotlin.time.Instant does not implement Parcelable. If you were passing Instant via Intents or Bundles, you must now pass Long primitives using toEpochMilliseconds() and reconstruct the instant with kotlin.time.Instant.fromEpochMilliseconds().
      • Note: kotlin.time.Instant.parse() only accepts ISO-8601 strings with a UTC offset. If you were relying on Instant.parse() to handle date-only strings (e.g. "2020-12-09") or strings without a timezone offset (e.g. "2020-12-09T09:16:56"), you must handle these formats manually before parsing.

    Fixed

    Navigator
    • Fixed loading of EPUB assets, such as fonts, referenced from publication resources. They were previously blocked by cross-origin (CORS) restrictions.

    What's Changed

    Full Changelog: https://github.com/readium/kotlin-toolkit/compare/3.2.0...3.3.0

  3. 3.2.02026-05-13 · 2026-05-13 15:11 UTC
    查看更新说明

    [!WARNING] Minor releases (a.B.c) of the Readium toolkit may now include minor breaking changes, such as dependency upgrades or small API modifications. Major version numbers are reserved for significant architectural changes.

    Documentation

    Changelog

    Added

    Navigator
    • Add animated page turns for EPUB paginated mode, by passing animated = true to go() APIs, or animatedTransition = true to the DirectionalNavigationAdapter (contributed by @marcprux).
    • New experimental positioning of EPUB decorations that places highlights behind text to improve legibility with opaque decorations (contributed by @ddfreiling).
      • To opt-in, initialize the EpubNavigatorFragment.Configuration object with decorationTemplates = HtmlDecorationTemplates.defaultTemplates(alpha = 1.0, experimentalPositioning = true).
    Streamer
    • Added httpClient parameter to the EpubParser constructor to support fetching EPUB remote resources from Publication objects (contributed by @m-abs).
    LCP
    • Added an initializer parameter for providing a custom device identifier (contributed by @dewantawsif).
      • You must ensure the identifier is unique and stable for the device (persist and reuse across app launches).
      • Recommended: generate an app-scoped UUID and store it securely. Avoid hardware or advertising identifiers.

    Deprecated

    Streamer
    • Removed title inference based on folder names within image and audio archives. Use the archive's filename instead.
    Shared

    Fixed

    Shared
    • Fixed a typo in the accessibility metadata (describeMath should be describedMath).
    Navigator
    • Fixed support for resources with absolute hrefs (contributed by @m-abs).
    • #782 Locator.Locations.time now supports decimal time fragment values (e.g. t=1.5) (contributed by @m-abs).

    What's Changed

  4. 3.1.22025-09-29 · 2025-09-29 10:48 UTC
    查看更新说明

    [!WARNING] Minor releases (a.B.c) of the Readium toolkit may now include minor breaking changes, such as dependency upgrades or small API modifications. Major version numbers are reserved for significant architectural changes.

    Resources

    Changelog

    Fixed

    Fixed

    Navigator
    • Fixed vertical text scrolling in EPUB for right-to-left reading progression (contributed by @shovel-kun).
    • Fixed notifying the current location when using vertical text scrolling in EPUB (contributed by @shovel-kun).
    • Fixed drawing EPUB decorators with vertical text (contributed by @shovel-kun).

    Commits

    New Contributors

    Full Changelog: https://github.com/readium/kotlin-toolkit/compare/3.1.1...3.1.2

  5. 3.1.12025-05-15 · 2025-05-15 10:58 UTC
    查看更新说明

    [!WARNING] Minor releases (a.B.c) of the Readium toolkit may now include minor breaking changes, such as dependency upgrades or small API modifications. Major version numbers are reserved for significant architectural changes.

    Resources

    Changelog

    Fixed

    • #662 Fixed duplicate class when using readium-adapter-pdfium.

    Commits

    New Contributors

    Full Changelog: https://github.com/readium/kotlin-toolkit/compare/3.1.0...3.1.1

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    Readium Kotlin Toolkit

    Readium Mobile is a toolkit for ebooks, audiobooks and comics written in Swift & Kotlin.

    :point_up: Take a look at the guide to quickly get started. A Test App demonstrates how to integrate the Readium Kotlin toolkit in your own reading app.

    :question: Find documentation and API reference at readium.org/kotlin-toolkit.

    Features

    ✅ Implemented      🚧 Partially implemented      📆 Planned      👀 Want to do      ❓ Not planned

    Formats

    FormatStatus
    EPUB 2✅
    EPUB 3✅
    Readium Web Publication🚧
    PDF✅
    Readium Audiobook✅
    Zipped Audiobook✅
    Standalone audio files (MP3, AAC, etc.)✅
    Readium Divina🚧
    CBZ (Comic Book ZIP)🚧
    CBR (Comic Book RAR)❓
    DAISY👀

    Features

    A number of features are implemented only for some publication formats.

    FeatureEPUB (reflow)EPUB (FXL)PDF
    Pagination✅✅✅
    Scrolling✅👀✅
    Right-to-left (RTL)✅✅✅
    Search in textual content✅✅👀
    Highlighting (Decoration API)✅✅👀
    Text-to-speech (TTS)✅✅👀
    Media overlays📆📆

    OPDS Support

    FeatureStatus
    OPDS Catalog 1.2✅
    OPDS Catalog 2.0✅
    Authentication for OPDS📆
    Readium LCP Automatic Key Retrieval📆

    DRM Support

    FeatureStatus
    Readium LCP✅
    Adobe ACS❓

    User Guides

    Guides are available to help you make the most of the toolkit.

    Publication

    Navigator

    DRM

    Setting up the Readium Kotlin toolkit

    Minimum Requirements

    ReadiumAndroid min SDKAndroid compile SDKKotlin compiler (✻)Gradle (✻)
    develop24372.4.209.7.0
    3.4.024372.4.209.7.0
    3.2.023362.3.209.1.0
    3.1.223362.1.218.14.1
    3.1.021352.1.208.13
    3.0.021341.9.248.6.0
    2.3.021331.7.106.9.3

    ✻ Only required if you integrate Readium as a submodule instead of using Maven Central.

    Dependencies

    Readium modules are distributed with Maven Central. Make sure that you have the $readium_version property set in your root build.gradle, then add the Maven Central repository.

    buildscript {
        ext.readium_version = '3.4.0'
    }
    
    allprojects {
        repositories {
            mavenCentral()
        }
    }
    

    Then, add the dependencies to the Readium modules you need in your app's build.gradle.

    dependencies {
        implementation "org.readium.kotlin-toolkit:readium-shared:$readium_version"
        implementation "org.readium.kotlin-toolkit:readium-streamer:$readium_version"
        implementation "org.readium.kotlin-toolkit:readium-navigator:$readium_version"
        implementation "org.readium.kotlin-toolkit:readium-opds:$readium_version"
        implementation "org.readium.kotlin-toolkit:readium-lcp:$readium_version"
    }
    

    :warning: You must enable core library desugaring in your application module.

    Using a local Git clone

    You may prefer to use a local Git clone if you want to contribute to Readium, or if you are using your own fork.

    First, add the repository as a Git submodule of your app repository, then checkout the desired branch or tag:

    git submodule add https://github.com/readium/kotlin-toolkit.git
    

    Then, include the Readium build to your project's settings.gradle file. The Readium dependencies will automatically build against the local sources.

    // Provide the path to the Git submodule.
    includeBuild 'kotlin-toolkit'
    

    :warning: When importing Readium locally, you will need to use the same version of the Android Gradle Plugin in your project.

    Building with Readium LCP

    Using the toolkit with Readium LCP requires additional dependencies, including the binary liblcp provided by EDRLab. Contact EDRLab to request your private liblcp and the setup instructions.