Readium Swift Toolkit
Readium Mobile is a toolkit for ebooks, audiobooks and comics written in Swift & Kotlin.
Tip
Take a look at the guide to quickly get started. A Test App demonstrates how to integrate the Readium Swift toolkit in your own reading app.
Features
Implemented Partially implemented Planned Want to do Not planned
Formats
Ebook and Document Formats
| Format | Status |
|---|---|
| EPUB (reflowable) | |
| EPUB (fixed-layout) | |
| Readium Web Publication | |
| DAISY |
Audiobook Formats
| Format | Status |
|---|---|
| Readium Audiobook | |
| Zipped Audiobook | |
| Standalone audio files (MP3, AAC, etc.) | |
| DAISY |
Comic Formats
| Format | Status |
|---|---|
| Readium Divina | |
| CBZ (Comic Book ZIP) | |
| CBR (Comic Book RAR) |
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 | |
| OPDS Progression | |
| 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
- Text-to-speech - read aloud the content of a textual publication using speech synthesis
- Accessibility - inspect accessibility metadata and present it 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
- Integrating the Navigator with SwiftUI - glue to setup the Navigator in a SwiftUI application
DRM
- Supporting Readium LCP - open and render LCP DRM protected publications
Setting up the Readium Swift toolkit
Minimum Requirements
| Readium | iOS | Swift compiler | Xcode |
|---|---|---|---|
develop |
15.0 | 6.0 | 16.4 |
| 3.7.0 | 15.0 | 6.0 | 16.4 |
| 3.0.0 | 13.4 | 5.10 | 15.4 |
| 2.5.1 | 11.0 | 5.6.1 | 13.4 |
| 2.5.0 | 10.0 | 5.6.1 | 13.4 |
| 2.4.0 | 10.0 | 5.3.2 | 12.4 |
Dependencies
The toolkit's libraries are distributed with Swift Package Manager (recommended), Carthage and CocoaPods. It's also possible to clone the repository (or a fork) and depend on the libraries locally.
The Test App contains examples on how to use all these dependency managers.
Swift Package Manager
From Xcode, open File > Add Packages and use Readium's GitHub repository for the package URL: https://github.com/readium/swift-toolkit.git.
You are then free to add one or more Readium libraries to your application. They are designed to work independently.
If you're stuck, find more information at developer.apple.com.
Carthage
Add the following to your Cartfile:
github "readium/swift-toolkit" ~> 3.7.0
Then, follow the usual Carthage steps to add the Readium libraries to your project.
Note that Carthage will build all Readium modules and their dependencies, but you are free to add only the ones you are actually using. The Readium libraries are designed to work independently.
Refer to the following table to know which dependencies are required for each Readium library.
ReadiumShared |
ReadiumStreamer |
ReadiumNavigator |
ReadiumOPDS |
ReadiumLCP |
ReadiumAdapterGCDWebServer |
ReadiumAdapterLCPSQLite |
|
|---|---|---|---|---|---|---|---|
ReadiumShared |
|||||||
ReadiumInternal |
|||||||
CryptoSwift |
|||||||
DifferenceKit |
|||||||
ReadiumFuzi |
|||||||
ReadiumGCDWebServer |
|||||||
ReadiumZIPFoundation |
|||||||
Minizip |
|||||||
SQLite.swift |
|||||||
SwiftSoup |
CocoaPods
Add the following pod statements to your Podfile for the Readium libraries you want to use:
source 'https://github.com/readium/podspecs'
source 'https://cdn.cocoapods.org/'
pod 'ReadiumShared', '~> 3.7.0'
pod 'ReadiumStreamer', '~> 3.7.0'
pod 'ReadiumNavigator', '~> 3.7.0'
pod 'ReadiumOPDS', '~> 3.7.0'
pod 'ReadiumLCP', '~> 3.7.0'