A lightweight JavaFX-based PDF reader built with Spring Boot and Apache PDFBox. It supports single-page and infinite-scroll modes, zooming, reading progress, search, and bookmarks.
- Viewer modes: Single Page ↔ Infinite Scroll toggle
- Navigation: Prev/Next buttons, jump-to-page, Page Up/Down keys
- Zoom: Slider and Ctrl + Mouse Wheel
- Reading progress: Auto-saves current page and scroll position
- Search: In-document and library search
- Bookmarks: Add and display bookmarks with overlay
- Lazy loading: Efficient page rendering in infinite scroll
- JavaFX UI: Toolbar with status/progress display
- Java: 17
- Build: Maven
- UI: JavaFX (controls, FXML)
- PDF: Apache PDFBox
- Framework: Spring Boot 3
- JSON: Jackson
See pom.xml versions:
- Spring Boot 3.1.2
- PDFBox 2.0.29
- JavaFX 21.0.1
- Java 17 (ensure
JAVA_HOMEpoints to JDK 17) - Maven 3.8+
- macOS/Linux/Windows
- Internet for first dependency resolution
- Build
mvn clean package- Run the GUI
mvn -DskipTests javafx:runThis uses the configured main class com.pdfreader.presentation.gui.PdfReaderGuiApplication.
- Run tests
mvn testsrc/main/java/com/pdfreader/presentation/gui/PdfReaderGuiApplication.java- Boots Spring context
- Loads
resources/fxml/pdf-reader-gui.fxml - Shows JavaFX stage
- Sets profile
guiandspring.main.web-application-type=none
com.pdfreader.presentation.gui.components.PdfViewerComponent- Renders pages via
PdfPageRenderer - Single Page / Infinite Scroll modes
- Zoom, keyboard navigation
- Progress via
ReadingProgressService - Search via
DocumentSearchServiceandLibrarySearchService - Bookmarks via
BookmarkServiceandBookmarkOverlay - Toolbar via
PdfViewerToolbar
- Renders pages via
src/main/java/— Application, GUI, components, services, domainsrc/main/resources/fxml/— FXML layouts (e.g.,pdf-reader-gui.fxml)
pom.xml— Dependencies and plugins (Spring Boot, JavaFX)
- Toggle view mode with the toolbar button
- Use the zoom slider or Ctrl + Mouse Wheel
- Enter a page number and press Enter to jump
- Use the search panel for document/library search
- Add bookmarks and view them on the overlay
- Java version:
java -versionshould be 17 - JavaFX runtime flags: Prefer
mvn javafx:runto avoid manual module args - FXML not found: Ensure
src/main/resources/fxml/pdf-reader-gui.fxmlexists and is on the classpath - Rendering issues: Verify PDF path and PDFBox dependency
- Slow first scroll: Infinite scroll lazily renders; first loads may take time
- Run from IDE using
PdfReaderGuiApplication - Controllers/components can use Spring DI (
springContext::getBean) - Add new FXML under
resources/fxml/and controllers underpresentation/gui/
MIT - see LICENSE.md