I built PDF Pro, a desktop PDF reader in Python with study and productivity features such as notes, annotations, image extraction, and optional local AI summarization.
The project started as a way to learn how desktop applications are structured beyond a simple command-line program. I wanted to build something practical: a PDF reader that could support reading, searching, organizing notes, and summarizing documents without requiring a cloud AI API key.
The result is PDF Pro v0.2.0.
What PDF Pro can do
PDF Pro includes:
- Tabbed PDF reading
- Previous/next page navigation and page number input
- PDF thumbnails
- Fit Width and zoom controls
- Night mode
- Full-text search with next and previous result navigation
- Text selection and copy
- Highlights, underlines, strike-through annotations, and an eraser
- Persistent bookmarks and notes
- Snapshot export for selected page regions
- Embedded-image extraction
- Optional local AI summaries through Ollama
The AI Hub can summarize:
- The current page
- Selected PDF text
- An entire text-based PDF
Users can also copy a generated summary or save it directly as a persistent PDF note.
Why I chose local AI
For the AI feature, I chose Ollama instead of making cloud AI mandatory.
That decision had a few advantages:
- Privacy — PDF text stays on the user's machine when Ollama runs locally.
- No API key required — users do not need to register for a cloud provider.
- No per-request inference bill — once a local model is installed, summaries can be generated without cloud API charges.
- Model choice — users can choose an installed local model based on their machine and preferences.
The PDF reader itself works without Ollama. AI summarization is optional.
To enable AI summaries, users install Ollama and download a local model:
ollama pull qwen2.5:3b
Then they open AI Hub in PDF Pro, click Refresh Models, choose a local model, choose a scope, and summarize.
Project architecture
I split the project into separate modules instead of keeping all logic in one file:
src/
├── main.py
├── ai_worker.py
├── ollama_service.py
├── pdf_service.py
├── pdf_page_view.py
├── embedded_image_service.py
├── night_mode_service.py
├── storage_service.py
└── reader_state.py
A few implementation decisions were especially useful:
-
PyMuPDFhandles PDF opening, text extraction, searching, page rendering, and embedded-image access. -
PySide6provides the desktop interface, including tabs, toolbars, dock widgets, dialogs, and signals. -
Pillowhandles rendered-image processing, annotation drawing, and night-mode image changes. -
storage_service.pypersists notes, bookmarks, annotations, and the last-read page locally. -
ai_worker.pyruns Ollama summarization outside the UI thread so the application remains responsive during generation.
A challenge: PDF text is not always simple
A key lesson from this project was that PDFs are not always structured like normal documents.
Some PDFs contain selectable text and work well with text search and summarization. Others are scanned pages made entirely from images. In those cases, normal text extraction returns little or no text.
PDF Pro handles this by showing clear feedback when no selectable text is available. OCR is a possible future improvement for scanned PDFs.
Another lesson was rendering. The current reader renders PDF pages into images for custom annotation and night-mode processing. That makes those features easier to control, but it differs from the vector rendering used by browser PDF viewers. Improving the rendering architecture is an area I want to explore in a future version.
What I learned
Building PDF Pro helped me practice:
- Designing a modular Python desktop application
- Using signals and widgets in PySide6
- PDF rendering and text extraction with PyMuPDF
- Local data persistence
- Background-thread work for AI requests
- Error handling for missing local services and models
- Release preparation with Git tags, GitHub Releases, and PyInstaller packaging
What is next
Possible future work includes:
- Annotation manager and export to Markdown or CSV
- OCR support for scanned PDFs
- Better accessibility features
- Cloud AI providers as an optional bring-your-own-key feature
- Additional local AI actions such as flashcards and document Q&A
- Cross-platform builds and more distribution testing
Try it
PDF Pro v0.2.0 is available on GitHub.
The release includes the source code and a Linux build. The core reader works on its own, while local AI summaries require Ollama plus an installed model.
If you try it, feedback on usability, PDF compatibility, or local-AI workflow would be very welcome.
Top comments (0)