PDF-Juggler
JVM-Based Pdf Reader App for Desktop
Created on 11th October 2025
•
PDF-Juggler
JVM-Based Pdf Reader App for Desktop
The problem PDF-Juggler solves
PDF Juggler
Introduction:
PDF Juggler is a comprehensive desktop PDF management application that provides an intuitive interface for reading, editing, and manipulating PDF documents. Built using Kotlin Multiplatform and Jetpack Compose Desktop, it offers advanced features like AI-powered document analysis, text-to-speech capabilities, and seamless PDF editing tools.
Table of Contents
- Technology Stack
- Features
- Installation & Setup
- Project Structure
- Building for Distribution
- Contributing
Technologies Used
- Kotlin Multiplatform
- Jetpack Compose Desktop
- Coroutines
- PDF Processing
- Apache PDFBox
- AI Integration
- Google Gemini API
- Text-to-Speech
- MaryTTS
- Networking
- Ktor Client
- UI Framework
- Compose Multiplatform
- Material 3 Design
- Voyager Navigation
Features
- PDF Viewing & Navigation: High-quality PDF rendering with smooth navigation and zoom controls
- Multi-Tab Support: Open and manage multiple PDF documents simultaneously
- AI-Powered Analysis: Generate table of contents and document summaries using Google Gemini AI
- Text-to-Speech: Convert PDF text to speech with MaryTTS integration
- Search & Highlight: Advanced text search with highlighting capabilities
- Bookmark Management: Create and manage bookmarks for quick navigation
- Page Management: Reorder, extract, and manipulate PDF pages
- Print Support: Advanced printing options with custom settings
- Encryption/Decryption: Secure document handling with encryption capabilities
- Auto-Updates: Built-in update mechanism for seamless application updates
- Cross-Platform: Desktop application targeting Windows, macOS, and Linux
Installation & Setup
Prerequisites
- JDK 17 or higher
- Gradle 8.0+
- An IDE with Kotlin support (IntelliJ IDEA recommended)
Steps to Run
-
Clone the Repository
git clone https://github.com/your-username/PDF-Juggler.git cd PDF-Juggler -
Configure Environment Variables (Required for AI features)
- Copy
sample_Env.kttoEnv.ktin the same directory:copy "composeApp\src\jvmMain\kotlin\com\jholachhapdevs\pdfjuggler\core\util\sample_Env.kt" "composeApp\src\jvmMain\kotlin\com\jholachhapdevs\pdfjuggler\core\util\Env.kt" - Edit the
Env.ktfile and replace placeholder values:GEMINI_API_KEY: Your Google Gemini API key for AI features- Get your API key from Google AI Studio
- Create a new project and enable the Gemini API
PREFS_KEY: A custom encryption key for preferences (16+ characters)
Note: The
Env.ktfile is already added to.gitignoreto keep your API keys secure. - Copy
-
Build and Run the Application
- On Windows:
.\gradlew.bat :composeApp:run - On macOS/Linux:
./gradlew :composeApp:run
- On Windows:
-
Start Using PDF Juggler!
- The application will launch with a modern desktop interface
- Open PDF files through the file menu or drag and drop
- Explore the various features through the intuitive UI
Project Structure
This is a Kotlin Multiplatform project with the following structure:
- /composeApp/src/commonMain - Shared code across platforms
- /composeApp/src/jvmMain - Desktop-specific implementations
feature/pdf/- PDF viewing and manipulationfeature/ai/- AI integration with Geminifeature/tts/- Text-to-speech functionalityfeature/update/- Application update managementcore/- Core utilities and UI components
Building for Distribution
To create distributable packages:
# Create MSI installer (Windows)
.\gradlew.bat :composeApp:packageMsi
# Create DMG installer (macOS)
./gradlew :composeApp:packageDmg
# Create DEB package (Linux)
./gradlew :composeApp:packageDeb
Challenges we ran into
Since we have no HTML, text highlighting was painful, we needed to calculate the X and Y coordinates of each letter on pdf and then we mapped it above the pdf..
We created our own way to highlight text, and we did it completely using Kotlin/Java
