How pierrebouvet/ai_pdf_viewer works
AI PDF Viewer is a local desktop application for reading and annotating PDFs, then asking questions or running reusable analysis prompts against selected document pages. The main workflow is to open a PDF, index its text, submit a prompt through the chat panel, and render the response in the chat UI. Separate branches handle PDF navigation and annotations, prompt-library and provider configuration, themes, and local-model timing estimates. The README also documents optional structured extraction; its implementation is not confirmed by the sampled source.
Main entry points: main_window.py Main Window · ai_assistant.py AI Assistant · ai_chat_panel.py AI Chat Panel · main.py Application Startup
Components 22
Desktop UI
- Application Startup
main.py - Main Window
ui/main_window.py - AI Chat Panel
ui/ai_chat_panel.py - Response Editor
ui/edit_message_dialog.py
PDF Workflow
- PDF Viewer
ui/pdf_view.py - Page Thumbnails
ui/thumbnail_panel.py - Annotation Toolbar
ui/annotation_toolbar.py - PDF Document
backend/pdf_document.py
AI Services
- AI Assistant
backend/ai_assistant.py - Response Estimator
backend/model_benchmark.py - Google Gemini
- Local Ollama
- Structured Extractor
backend/pdf_document.py
Settings and Prompts
- AI Configuration
ui/config_dialog.py - App Configuration
backend/config_manager.py - Prompt Manager UI
ui/prompts_dialog.py - Prompt Library
backend/prompts_manager.py
Shared UI Support
- Theme Manager
ui/theme_manager.py - Markdown Renderer
backend/markdown_renderer.py - Offline Asset Loader
ui/asset_loader.py - Application Logger
backend/logger.py
Other components
- Researcher
Connections 31
- Researcher → Application Startup: starts
README.md - Application Startup → Main Window: launches
main.py - Application Startup → App Configuration: initializes
main.py - Application Startup → Theme Manager: configures
main.py - Application Startup → AI Assistant: initializes
main.py - Main Window → PDF Viewer: hosts
ui/main_window.py - Main Window → AI Chat Panel: hosts
ui/main_window.py - Main Window → Page Thumbnails: hosts
ui/main_window.py - Main Window → AI Configuration: opens
ui/main_window.py - Main Window → Prompt Manager UI: opens
ui/main_window.py - Main Window → PDF Document: manages
ui/main_window.py - Main Window → AI Assistant: requests answers
ui/main_window.py - Main Window → Prompt Library: loads prompts
ui/main_window.py - Main Window → Theme Manager: applies theme
ui/main_window.py - PDF Viewer → PDF Document: renders and edits
ui/pdf_view.py - PDF Viewer → Annotation Toolbar: uses tools
ui/pdf_view.py - Page Thumbnails → PDF Document: reads pages
ui/thumbnail_panel.py - AI Chat Panel → AI Assistant: submits prompts
ui/ai_chat_panel.py - AI Chat Panel → Markdown Renderer: renders responses
ui/ai_chat_panel.py - AI Chat Panel → Theme Manager: styles interface
ui/ai_chat_panel.py - AI Chat Panel → Response Editor: opens editor
ui/ai_chat_panel.py - AI Chat Panel → Response Estimator: estimates duration
- AI Assistant → App Configuration: reads settings
backend/ai_assistant.py - AI Assistant → Response Estimator: records throughput
backend/ai_assistant.py - AI Assistant → Google Gemini: requests inference
README.md - AI Assistant → Local Ollama: requests inference
README.md - AI Configuration → App Configuration: updates settings
ui/config_dialog.py - AI Configuration → AI Assistant: configures provider
ui/config_dialog.py - Prompt Manager UI → Prompt Library: edits library
ui/prompts_dialog.py - Theme Manager → Offline Asset Loader: loads icons
ui/theme_manager.py - PDF Document → Structured Extractor: optionally extracts
README.md