必须在应用模块启用 core library desugaring;以本地 Git 子模块方式集成时需与项目使用相同版本的 Android Gradle Plugin;使用 Readium LCP 需联系 EDRLab 获取私有 liblcp 及配置说明
kotlin-toolkit
readiumBSD-3-Clause活跃维护用 Kotlin 写的电子书、有声书和漫画阅读工具包,帮开发者在 Android 上快速集成 EPUB、PDF、CBZ 阅读与有声书播放能力。
A toolkit for ebooks, audiobooks and comics written in Kotlin
ext.readium_version = '3.4.0'
implementation "org.readium.kotlin-toolkit:readium-shared:$readium_version"README 未说明;仅要求 Android min SDK 24、compile SDK 37(3.4.0 版本)
用 Kotlin 写的电子书、有声书和漫画阅读工具包,帮你快速搭建 Android 阅读应用
用 Kotlin 写的电子书、有声书和漫画阅读工具包,帮开发者在 Android 上快速集成 EPUB、PDF、CBZ 阅读与有声书播放能力。
核心能力
- 解析 EPUB、PDF、有声书等格式为 Publication 模型
- 提供 Navigator 渲染内容并支持翻页、滚动与 RTL
- 支持 EPUB 文本搜索、高亮与 TTS 朗读
- 内置 OPDS 1.2/2.0 目录与 Readium LCP DRM 支持
- 附带 Test App 演示如何集成到自己的应用
容易踩的坑
- 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
- Versioned Documentation – Complete API reference on readium.org.
- Migration Guide – Instructions for upgrading from previous versions.
Changelog
:warning: The minimum supported Android version is now API 24 (Android 7.0).
Added
Navigator
- Added a
scrollpreference to the PDFium adapter, to switch between a continuous scroll layout (true) and a paginated one (false) snapping to page boundaries. The existingscrollAxispreference is only effective whenscrollis 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.targetElementproperty, 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:
currentLocatorwas one page ahead of the visible page, the first page was never reported, and the last page never updatedcurrentLocator(contributed by @huttarl).- :warning: You must migrate the
Locatorobjects 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 newPublication.migrateLegacyPdfiumLocator()helper and take a look at the migration guide.
- :warning: You must migrate the
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 OKstatus, 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/?queryinstead 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
- Replace NetworkService with HttpClient in LCP by @stevenzeck in https://github.com/readium/kotlin-toolkit/pull/794
- Fix crashes on zero-size WebView and disposed scroll controller by @qnga in https://github.com/readium/kotlin-toolkit/pull/799
- Fix Dokka by @stevenzeck in https://github.com/readium/kotlin-toolkit/pull/801
- Replace drafts.opds.io with specs.opds.io by @mickael-menu with @Copilot in https://github.com/readium/kotlin-toolkit/pull/806
- Revert OPDS Authentication URL to drafts endpoint by @mickael-menu with @Copilot in https://github.com/readium/kotlin-toolkit/pull/807
- Refactor rendition preferences in new navigators by @qnga in https://github.com/readium/kotlin-toolkit/pull/805
- Fix poorl
- 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
- Versioned Documentation – Complete API reference on readium.org.
- Migration Guide – Instructions for upgrading from previous versions.
Changelog
Deprecated
Shared
- The
Instantutility class is deprecated in favor ofkotlin.time.Instant. UseClock.System.now()to get the current time.- Note:
kotlin.time.Instantdoes not implementParcelable. If you were passingInstantvia Intents or Bundles, you must now passLongprimitives usingtoEpochMilliseconds()and reconstruct the instant withkotlin.time.Instant.fromEpochMilliseconds(). - Note:
kotlin.time.Instant.parse()only accepts ISO-8601 strings with a UTC offset. If you were relying onInstant.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.
- Note:
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
- Remove material icons extended dependency by @stevenzeck in https://github.com/readium/kotlin-toolkit/pull/778
- Fix Dokka by @stevenzeck in https://github.com/readium/kotlin-toolkit/pull/792
- Deprecate Shared Instant and replace uses of it with Kotlin Instant by @stevenzeck in https://github.com/readium/kotlin-toolkit/pull/781
- Add release automation scripts by @mickael-menu in https://github.com/readium/kotlin-toolkit/pull/791
- Refactor LCP to remove koi and joda by @stevenzeck in https://github.com/readium/kotlin-toolkit/pull/780
- Allow assets to be consumed in publication resources by @qnga in https://github.com/readium/kotlin-toolkit/pull/797
- 3.3.0 by @mickael-menu in https://github.com/readium/kotlin-toolkit/pull/798
Full Changelog: https://github.com/readium/kotlin-toolkit/compare/3.2.0...3.3.0
- 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
- Versioned Documentation – Complete API reference on readium.org.
- Migration Guide – Instructions for upgrading from previous versions.
Changelog
Added
Navigator
- Add animated page turns for EPUB paginated mode, by passing
animated = truetogo()APIs, oranimatedTransition = trueto theDirectionalNavigationAdapter(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.Configurationobject withdecorationTemplates = HtmlDecorationTemplates.defaultTemplates(alpha = 1.0, experimentalPositioning = true).
- To opt-in, initialize the
Streamer
- Added
httpClientparameter to theEpubParserconstructor to support fetching EPUB remote resources fromPublicationobjects (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
- The Presentation Hints properties are deprecated from the Readium Web Publication Manifest models. See the official documentation.
Fixed
Shared
- Fixed a typo in the accessibility metadata (
describeMathshould bedescribedMath).
Navigator
- Fixed support for resources with absolute hrefs (contributed by @m-abs).
- #782
Locator.Locations.timenow supports decimal time fragment values (e.g.t=1.5) (contributed by @m-abs).
What's Changed
- Prevent multiple OutlineFragment instances on repeated menu clicks. by @janiceferns02 in https://github.com/readium/kotlin-toolkit/pull/719
- Update dependencies and JVM target by @qnga in https://github.com/readium/kotlin-toolkit/pull/717
- fix(tts): add missing supported timeline command to TtsSessionAdapter by @ddfreiling in https://github.com/readium/kotlin-toolkit/pull/716
- Add experimental EPUB decoration positioning by @ddfreiling in https://github.com/readium/kotlin-toolkit/pull/721
- Allow custom LCP device identifiers by @dewantawsif in https://github.com/readium/kotlin-toolkit/pull/720
- Fix File.toUrl and DirectoryContainer by @qnga in https://github.com/readium/kotlin-toolkit/pull/727
- Fix typo in
describedMatha11y feature by @mickael-menu in https://github.com/readium/kotlin-toolkit/pull/731 - GitHub Actions CI Build Improvements by @stevenzeck in https://github.com/readium/kotlin-toolkit/pull/732
- Update Dokka, fix documentation generation by @stevenzeck in https://github.com/readium/kotlin-toolkit/pull/740
- Remove title inference based on folder names for raw archives by @mickael-menu in https://github.com/readium/kotlin-toolkit/pull/741
- Update Kotlin, Gradle, and other dependencies by @stevenzeck in h
- 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
- Fixed 16 KB page sizes support (contributed by @gustavaa).
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
- fix: properly scroll vertical text by @shovel-kun in https://github.com/readium/kotlin-toolkit/pull/656
- fix: correctly decorators for vertical scrolling pages by @shovel-kun in https://github.com/readium/kotlin-toolkit/pull/671
- feat: support TTSNavigator and text search for WebPubs with HTML content by @ddfreiling in https://github.com/readium/kotlin-toolkit/pull/682
- Update dependencies and Android SDK by @stevenzeck in https://github.com/readium/kotlin-toolkit/pull/678
- Migrate to Central Portal for Maven Publishing by @mickael-menu in https://github.com/readium/kotlin-toolkit/pull/684
- Upgrade to kotlinx-datetime 0.7.1 by @erkasraim in https://github.com/readium/kotlin-toolkit/pull/697
- Revisit the new fxl navigator and introduce a reflowable one by @qnga in https://github.com/readium/kotlin-toolkit/pull/680
- Fix 16K support for PDFium by @gustavaa in https://github.com/readium/kotlin-toolkit/pull/710
- 3.1.2 by @mickael-menu in https://github.com/readium/kotlin-toolkit/pull/715
New Contributors
- @shovel-kun made their first contribution in https://github.com/readium/kotlin-toolkit/pull/656
- @gustavaa made their first contribution in https://github.com/readium/kotlin-toolkit/pull/710
Full Changelog: https://github.com/readium/kotlin-toolkit/compare/3.1.1...3.1.2
- 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
- Allow blank issues by @mickael-menu in https://github.com/readium/kotlin-toolkit/pull/655
- Fix duplicate class with the PDFium adapter by @mickael-menu in https://github.com/readium/kotlin-toolkit/pull/663
- fix: corrected typo 'spread-node' to 'spread-none' by @BienBoy in https://github.com/readium/kotlin-toolkit/pull/664
- 3.1.1 by @mickael-menu in https://github.com/readium/kotlin-toolkit/pull/665
New Contributors
- @BienBoy made their first contribution in https://github.com/readium/kotlin-toolkit/pull/664
Full Changelog: https://github.com/readium/kotlin-toolkit/compare/3.1.0...3.1.1
- #662 Fixed duplicate class when using
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
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
| Format | Status |
|---|---|
| EPUB 2 | ✅ |
| EPUB 3 | ✅ |
| Readium Web Publication | 🚧 |
| ✅ | |
| 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.
| Feature | EPUB (reflow) | EPUB (FXL) | |
|---|---|---|---|
| Pagination | ✅ | ✅ | ✅ |
| Scrolling | ✅ | 👀 | ✅ |
| Right-to-left (RTL) | ✅ | ✅ | ✅ |
| Search in textual content | ✅ | ✅ | 👀 |
| Highlighting (Decoration API) | ✅ | ✅ | 👀 |
| Text-to-speech (TTS) | ✅ | ✅ | 👀 |
| Media overlays | 📆 | 📆 |
OPDS Support
| Feature | Status |
|---|---|
| OPDS Catalog 1.2 | ✅ |
| OPDS Catalog 2.0 | ✅ |
| Authentication for OPDS | 📆 |
| Readium LCP Automatic Key Retrieval | 📆 |
DRM Support
| Feature | Status |
|---|---|
| Readium LCP | ✅ |
| Adobe ACS | ❓ |
User Guides
Guides are available to help you make the most of the toolkit.
Publication
- Opening a publication – parse a publication package (EPUB, PDF, etc.) or manifest (RWPM) into Readium
Publicationmodels - Extracting the content of a publication – API to extract the text content of a publication for searching or indexing it
- Supporting PDF documents – setup the PDF support in the toolkit
- Text-to-speech – read aloud the content of a textual publication using speech synthesis
- Accessibility – inspect and present accessibility metadata to users
Navigator
- Navigator - an overview of the Navigator to render a
Publication's content to the user - Configuring the Navigator – setup and render Navigator user preferences (font size, colors, etc.)
- Font families in the EPUB navigator – support custom font families with reflowable EPUB publications
- EPUB image viewer – detect when a user taps an image to present it full screen
- Media Navigator – use the Media Navigator to read aloud a publication (audiobook, TTS, etc.)
- Web Navigators - a guide to the new alpha Compose-based navigators for EPUB
DRM
- Supporting Readium LCP – open and render LCP DRM protected publications
Setting up the Readium Kotlin toolkit
Minimum Requirements
| Readium | Android min SDK | Android compile SDK | Kotlin compiler (✻) | Gradle (✻) |
|---|---|---|---|---|
develop | 24 | 37 | 2.4.20 | 9.7.0 |
| 3.4.0 | 24 | 37 | 2.4.20 | 9.7.0 |
| 3.2.0 | 23 | 36 | 2.3.20 | 9.1.0 |
| 3.1.2 | 23 | 36 | 2.1.21 | 8.14.1 |
| 3.1.0 | 21 | 35 | 2.1.20 | 8.13 |
| 3.0.0 | 21 | 34 | 1.9.24 | 8.6.0 |
| 2.3.0 | 21 | 33 | 1.7.10 | 6.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.