Skip to content

Architecture

K M Rejowan Ahmmed edited this page Oct 25, 2026 · 1 revision

Architecture

PDF Reader Pro is a single-module Android app written entirely in Kotlin, with a Jetpack Compose UI, organized as Clean Architecture with MVVM.

Tech stack

Area Library
UI Jetpack Compose, Material 3
Navigation Navigation Compose with typed routes
Dependency injection Koin
Database Room (favorites, recent files, bookmarks, highlights, signatures)
Preferences DataStore
Async Kotlin Coroutines, StateFlow
PDF viewing Mozilla PDF.js in a WebView
PDF processing iText (merge, split, compress, rotate, pages, watermark, lock, unlock)
Images Coil
Logging Timber

Packages

app/src/main/java/com/rejowan/pdfreaderpro/
├── data/            # Room database, DAOs, DataStore, repository implementations
├── domain/          # models and repository interfaces
├── presentation/
│   ├── components/  # shared Compose components, including the PDF viewer
│   ├── navigation/  # routes and navigation graph
│   ├── screens/     # home, folders, reader, tools, settings, onboarding
│   └── theme/       # Material 3 theme
├── di/              # Koin modules
└── util/            # file operations, versions, language, crash handling

Each screen has a Compose UI and a ViewModel that exposes a single state object as a StateFlow; the UI sends actions to the ViewModel.

The PDF viewer

The reader embeds PDF.js, bundled in app/src/main/assets/com/rejowan/mozilla/:

  • build/ and pdfjs/ are the PDF.js build and viewer.
  • pdfjs/helper_main.js and pdfjs/helper_methods.js are the app's own scripts: they connect the viewer to Kotlin through a JavaScript interface and implement features such as reading themes, highlights, centering and the jump inset.
  • web/cmaps/ holds the character maps needed for Chinese, Japanese and Korean PDFs.

presentation/components/pdf/PdfViewer.kt wraps the WebView and exposes the viewer to Compose.

A few features edit the vendored PDF.js files directly. They're listed under Upgrading PDF.js in CONTRIBUTING.md, and BundledPdfJsPatchesTest fails if an upgrade drops one.

Languages

res/values/strings.xml is English. Other languages live in values-<code>/ and are synced from Crowdin. util/AppLanguage.kt lists the supported languages and applies the in-app language choice through AppCompat.

Updates

The app compares its version with the latest GitHub release (util/VersionUtils.kt), shows the release notes, and downloads and installs the APK on request.

Clone this wiki locally