A modern PDF viewer application built with Rust and Dioxus, featuring AI-powered search capabilities using Gemini.
- Dynamic File Selection: Open and close PDF files through an intuitive file dialog interface
- High-Quality PDF Display: Renders PDF pages at 1000x1400 resolution for balanced quality and performance
- Continuous Scroll: View all PDF pages in a seamless continuous scroll interface
- AI-Powered Search: Integrated multi-provider AI API (Gemini, ChatGPT, Claude) for intelligent content analysis and term explanations
- Flashcard System: Automatic vocabulary flashcard creation from search terms with persistent storage and popup interface
- Reading Bookmark System: Page-level bookmark functionality to track reading progress across sessions
- Position Marker System: Precise in-page position markers with automatic scrolling navigation
- PDF Page Rotation: Individual page rotation with persistent state across sessions
- Recent Files History: Quick access to recently opened PDF files (up to 10 files)
- API Key Management: Automatic saving and restoration of AI provider API keys
- Modern UI: Clean, responsive interface built with Dioxus framework
- Optimized Layout: Specially designed for vertical PDF documents with horizontal AI search panel
- Smart Caching: Intelligent page caching system with optimized loading to prevent unnecessary re-rendering
- Cross-platform: Desktop application with native performance
- Dioxus - Modern reactive UI framework for Rust
- pdfium-render - PDF rendering using Google's PDFium library
- rfd - Native file dialog integration for file selection
- Reqwest - HTTP client for AI search functionality
- Tokio - Async runtime for non-blocking operations
- Serde - JSON serialization for API communication
- Base64 - Image encoding for web display
This application requires Rust and Cargo. Install them from the official website:
Windows, macOS, and Linux:
Alternative Installation Methods:
macOS (via Homebrew):
Ubuntu/Debian:
CentOS/RHEL/Fedora:
To use the AI search functionality, obtain one or more of the following API keys:
Gemini API (Google): https://makersuite.google.com/app/apikey
ChatGPT API (OpenAI): https://platform.openai.com/api-keys
Claude API (Anthropic): https://console.anthropic.com/
- Launch the application - no arguments required
- Open a PDF file:
- Click the "📁 PDFを開く" (Open PDF) button in the header
- Select a PDF file from the file dialog
- View PDF content:
- All pages are displayed in a continuous scroll format
- Loading progress is shown at the top during initial page rendering
- Individual page rotation controls (90° increments) with persistence
- Reading Progress Management:
- Bookmarks: Use "🔖 ブックマーク" to set page-level reading bookmarks
- Position Markers: Enable "📍 マーカーモード" to place precise location markers within pages
- Automatic Navigation: Click markers in "📋 マーカー一覧" for automatic page scrolling
- Recent Files: Access recently opened files via "📋 最近のファイル"
- AI Search functionality:
- Select AI provider: Gemini, ChatGPT, or Claude
- Enter your API key once - it will be automatically saved and restored in future sessions
- Type your search query to ask about terms or concepts
- Click "検索" (Search) to get AI-powered explanations
- Searched terms are automatically saved to your flashcard collection
- File management:
- Use "❌ 閉じる" (Close) button to close the current PDF
- Open different files without restarting the application
- Header Bar: File control buttons and application title
- "🔖 ブックマーク" (Bookmarks) button for reading progress management
- "📍 マーカーモード" (Marker Mode) toggle for position marking
- "📋 マーカー一覧" (Marker List) for viewing and navigating to saved markers
- "📋 最近のファイル" (Recent Files) for quick file access
- "📁 PDFを開く" (Open PDF) button for file selection
- "❌ 閉じる" (Close) button to close current PDF
- Status Bar: Loading progress and PDF information (when PDF is loaded)
- Main Content Area:
- Left Panel: PDF display area optimized for vertical documents with continuous scroll
- Right Panel: AI search interface
- AI provider selection (Gemini, ChatGPT, Claude)
- API key input (password field) with automatic save/restore
- Search query input for term explanations
- Search button with loading indicator
- Results area with clean text formatting
- Flashcard button to view saved search terms
- Welcome Screen: Displayed when no PDF is loaded with usage instructions
The application automatically saves search terms and their AI-generated definitions as flashcards for future reference.
Storage Location:
- macOS: ~/.config/pdf-viewer/
- Linux: ~/.config/pdf-viewer/
- Windows: %USERPROFILE%\.config\pdf-viewer\
Data Files:
- flashcards.json - Saved search terms and definitions
- recent_files.json - Recently opened PDF files (max 10)
- api_keys.json - Saved API keys for AI providers
- bookmarks.json - Reading bookmarks for each PDF file
- position_markers.json - Precise position markers within PDF pages
- page_rotations.json - Individual page rotation states
Data Format: Flashcards are stored in JSON format with the following structure:
Features:
- Automatic saving when AI search is performed
- Duplicate term detection (updates existing definitions)
- Persistent storage across application sessions
- Popup interface for browsing saved flashcards
- Individual flashcard deletion capability
- PDF pages rendered at 1000x1400 pixels for balanced quality and performance
- Continuous scroll display for all pages at once
- Automatic color space conversion (BGRA → RGBA)
- PNG encoding with base64 data URLs for web display
- Asynchronous Gemini API calls that don't block the UI
- Markdown formatting removal for clean text display
- Real-time search status indicators
- Comprehensive error handling
- Smart page-level caching system using HashMap with duplicate loading prevention
- Optimized parallel page rendering with CPU-aware batch processing
- Memory-efficient image handling with color space optimization
- Responsive UI updates with non-blocking async operations
- Single-load policy to prevent unnecessary re-rendering of same PDF files
- Reactive state management with use_signal
- Memoized computations with use_memo
- Component-based design patterns
- CSS-in-Rust styling approach
- PDF Rendering: render_pdf_page_with_text() function handles high-resolution page rendering with text extraction
- File Management: Dynamic PDF loading/closing with native file dialog integration and recent files history
- Reading Progress: Bookmark and position marker systems with JSON persistence and automatic navigation
- Page Rotation: Individual page rotation controls with state persistence
- AI Search: search_with_ai() async function for multi-provider API integration
- Text Processing: clean_markdown_text() for formatting search results
- UI Components: Reactive Dioxus components with modern state management and responsive layout
- JavaScript Integration: eval() function for automatic page scrolling and DOM manipulation
All dependencies are optimized for the Dioxus ecosystem, removing legacy egui dependencies for a cleaner, more maintainable codebase.
This project is licensed under the terms specified in the LICENSE file.
.png)

