Material You 3 eBook/audiobook reader — Episteme fork + bookshelf-api/ABS
Find a file
Aryan 1e879eb604
Pdf text reflow (#36)
* Implemented PDF reflow mode by introducing a mechanism to convert PDF content to Markdown/HTML for viewing in the EPUB reader.

Specific changes include:
- Added `PdfReflowGenerator` and `PdfToMarkdownGenerator` to handle PDF text extraction and conversion to reflowable formats.
- Updated `MainViewModel` with `toggleReflowMode` logic to switch between original PDF and reflowed views.
- Modified `RecentFileEntity` and `RecentFileDao` to persist user reflow preferences, including a Room database migration (v12 to v13).
- Updated `PdfViewerScreen` and `EpubReaderControls` to include UI options for toggling reflow mode.
- Integrated reflow preference check into the book opening workflow to automatically load the preferred view.
- Updated `AppNavigation` and `EpubReaderScreen` to support the new view switching state.

* Implemented background processing and incremental loading for PDF reflow mode.

- Added `reflowProgress` to `MainViewModel` to track and display PDF-to-Markdown conversion progress in the UI.
- Refactored `PdfToMarkdownGenerator` to generate a skeleton EPUB structure immediately while processing page content (text and images) asynchronously.
- Switched PDF text extraction to use `PDFBox` with optimized memory settings and JPEG compression for images.
- Implemented priority page processing in reflow mode, starting with the user's current page.
- Added "Clear Reflow Cache" debug option to the Home Screen.
- Enhanced `BookPaginator` to support lazy loading of chapter content from disk and improved cache hit detection.

* Refactored PDF Reflow Mode to generate standalone Markdown files instead of temporary EPUB books.

* perf(reflow): optimize PDF-to-Markdown conversion and fix viewing lag

- Re-architected PdfToMarkdownGenerator to use a single-pass stream (O(N) complexity), fixing performance bottlenecks and timeouts on large PDFs.
- Implemented "Virtual Chaptering" in SingleFileImporter for Markdown files to split content into page-level HTML files, eliminating UI lag during reading.
- Simplified ReflowWorker to delegate progress tracking and looping to the generator.
- Enhanced PdfViewerScreen with a prominent top-bar progress indicator and a completion snackbar with an "OPEN" action.

* Optimized EPUB parsing performance and fixed PDF viewer UI layout.

- Optimized `EpubParser` by implementing parallel chapter parsing using coroutines and a semaphore to limit concurrency.
- Reduced memory usage in `EpubParser` and `SingleFileImporter` by no longer storing full HTML content in memory for chapters.
- Updated `EpubXMLFileParser` to support an existing `Document` object to avoid redundant Jsoup parsing.
- Fixed an issue in `PdfViewerScreen` where the snackbar was appearing under the bottom app bar.
2026-03-07 16:10:34 +05:30
.github Update GitHub sponsor button with a username (#8) 2026-02-26 18:44:11 +05:30
app Pdf text reflow (#36) 2026-03-07 16:10:34 +05:30
docs docs: Revamp README and add APK naming convention (#2) 2026-02-25 19:54:43 +05:30
fastlane/metadata/android/en-US use HTML for fastlane full description (#15) 2026-02-27 21:59:10 +05:30
gradle Initial commit 2026-02-24 17:37:40 +05:30
spotless Update readme (#3) 2026-02-25 21:30:28 +05:30
.gitattributes Initial commit 2026-02-24 17:37:40 +05:30
.gitignore docs: add CLA and CONTRIBUTING guidelines (#26) 2026-03-04 10:19:17 +05:30
build.gradle.kts docs: Revamp README and add APK naming convention (#2) 2026-02-25 19:54:43 +05:30
CLA.md docs: add CLA and CONTRIBUTING guidelines (#26) 2026-03-04 10:19:17 +05:30
CONTRIBUTING.md Added stylus-only mode for PDF drawing and annotations. (#27) 2026-03-04 13:18:26 +05:30
gradle.properties Initial commit 2026-02-24 17:37:40 +05:30
gradlew Initial commit 2026-02-24 17:37:40 +05:30
gradlew.bat Initial commit 2026-02-24 17:37:40 +05:30
LICENSE docs: add README, LICENSE, and configure automated license headers 2026-02-25 16:54:51 +05:30
README.md Fix icon and name alignment in readme (#4) 2026-02-25 21:34:06 +05:30
settings.gradle.kts build: remove foojay-resolver-convention plugin for f-droid compliance (#12) 2026-02-27 15:08:39 +05:30

Episteme Reader Icon  Episteme Reader

A native Android document reader application built with Kotlin and Jetpack Compose.

Get it on Google Play

Episteme Reader Preview

Overview

Episteme Reader is an offline-first application designed for reading various document formats. It leverages native Android technologies and C++ libraries to provide a performant reading experience with customization capabilities.

Note: This is the Open Source (OSS) edition of Episteme Reader. The version available on the Google Play Store is built from this core but includes additional proprietary features.

Features

Supported Formats

  • Documents: PDF
  • E-books: EPUB, MOBI, AZW3
  • Text: MD, TXT, HTML

PDF Features

  • Viewing Modes: Vertical Scroll and Paginated view.
  • Ink Annotations: Draw directly on pages using Pen, Highlighter, and Eraser tools.
  • Text Annotations: Add text notes anywhere on the page using system or custom fonts.

E-Book Features

  • Parsing: Native parsing for MOBI/AZW3 via libmobi and EPUB via Jsoup.
  • Customization: Adjust font size, line spacing, and margins.
  • Custom Fonts: Support for importing user-provided font files (.ttf, .otf).

General

  • Text-to-Speech (TTS): Read documents aloud using the system TTS engine.
  • File Management: Built-in library organization.

Architecture

  • UI: 100% Jetpack Compose (Material3).
  • Architecture: MVVM with Unidirectional Data Flow.
  • Database: Room (SQLite) for metadata and annotations.
  • PDF Engine: pdfium-android (Native PDFium bindings).
  • EPUB Engine: Utilizes standard WebView for vertical scrolling mode, and a custom rendering engine for paginated mode.
  • Mobi Engine: Custom JNI bindings to libmobi.

Building from Source

  1. Clone the repository:

    git clone https://github.com/Aryan-Raj3112/episteme.git
    cd episteme
    
  2. Build: Open in Android Studio and run the ossDebug variant.

    ./gradlew assembleOssDebug
    

Open Source Libraries

This project is made possible by the Android open-source ecosystem:

  • Core & UI: AndroidX, Jetpack Compose, Kotlinx Serialization
  • Document Engines: PdfiumAndroidKt (PDF), libmobi (MOBI/AZW3), Google WOFF2 (Fonts)
  • Parsers: Jsoup (HTML/EPUB), Flexmark (Markdown)
  • Media & Image Loading: Coil, Media3 (ExoPlayer)
  • Utilities: Room (Database), Timber (Logging)

License

This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). See the LICENSE file for details.