How srikanth-mohankumar/neoview works
Purpose and Entry Points
NeoView is a native Linux/Windows desktop PDF review application: viewing, navigation, search, measurement, crop-to-PNG export, annotation, bookmarks, and reload-aware sessions. The Qt application starts through src/neoview/__main__.py and src/neoview/app.py; pdf_crop_measure.py preserves a legacy launch path. Packaging exposes an installed neoview command via pyproject.toml.
Desktop Runtime and PDF Boundary
The runtime is Python 3.10+ with PySide6 for the event-driven desktop UI and PyMuPDF for PDF reading, text/font inspection, rendering, export, and annotation-related operations. The application boundary is local files and native desktop services (filesystem, clipboard, dialogs); no server or cloud service is implied. Core resource and visual setup reside in src/neoview/resources.py and src/neoview/theme.py.
Application Shell and Document Tabs
src/neoview/ui/main_window.py is the composition root and primary controller for multi-document tabs, menus/toolbars, docked panels, keyboard commands, document lifecycle, session restoration, and file-change reload coordination. It owns high-level transitions such as opening/reusing a tab, switching active documents, and preserving per-document state. src/neoview/app.py creates the Qt process/window and supplies startup file arguments.
PDF View, Rendering, and Interaction
src/neoview/ui/pdf_view.py is the main canvas boundary between PDF-backed document data and interactive Qt graphics. It drives page rendering, zoom/fit/rotation, page navigation, text/search overlays, thumbnails or visible-page behavior, and native annotation display. Page-level graphics are represented by src/neoview/ui/page_item.py; user rectangular selection, manipulation handles, and measurement geometry are encapsulated in src/neoview/ui/selection.py.
State and Persistence
Typed in-memory per-view/per-tab state is centralized in src/neoview/models/view_state.py, covering document session concerns such as page/zoom and feature state described by the UI. Durable user-created annotations and bookmarks are separated from source PDFs in sidecar files through src/neoview/persistence/sidecar_store.py. This boundary lets reloads and source-PDF changes retain NeoView state, while annotated-PDF export remains an explicit output workflow rather than destructive source modification.
Review Workflows
Selection feeds several downstream actions: unit conversion and display through src/neoview/utils/units.py, crop/export, measurement copying, and creating annotations. Annotation creation, editing, list/filtering, and tool controls are split between src/neoview/ui/annotation_item.py and src/neoview/ui/annotation_toolbar.py. Dialog-driven workflows—open/save, export choices, properties, and document-related panels—are concentrated in src/neoview/ui/dialogs.py.
Distribution and Deployment
Native installation is the primary deployment model (pyproject.toml, setup.py), supplemented by platform launch scripts. Windows standalone builds use PyInstaller configuration in neoview.spec; Dockerfile supports reproducible or development-oriented container use rather than the core user path. CI is defined in .github/workflows/ci.yml, with a separate Windows build pipeline in .github/workflows/windows-build.yml.
Main entry points: main_window.py Main window · pdf_view.py PDF view · annotation_item.py Annotation UI · app.py Qt application bootstrap
Components 19
Desktop Runtime
- Module entry point
src/neoview/__main__.py - Qt application bootstrap · Creates the Qt process, main window, and startup file handling.
src/neoview/app.py - PySide6 desktop services · Event loop, widgets, graphics, dialogs, clipboard, and filesystem integration.
- PyMuPDF · Reads, inspects, renders, exports, and annotates PDFs.
UI Shell & Canvas
- Main window · Coordinates tabs, commands, document lifecycle, reloads, and sessions.
src/neoview/ui/main_window.py - PDF view · Connects PDF data to rendering, navigation, zoom, search, and overlays.
src/neoview/ui/pdf_view.py - Page graphics
src/neoview/ui/page_item.py - Selection & measurement · Owns rectangular selection, handles, and measurement geometry.
src/neoview/ui/selection.py - Annotation UI · Provides annotation items, editing, filtering, and tool controls.
src/neoview/ui/annotation_item.py - Annotation toolbar
src/neoview/ui/annotation_toolbar.py - Document dialogs · Handles open/save, export, properties, and document panels.
src/neoview/ui/dialogs.py - Resources
src/neoview/resources.py - Theme
src/neoview/theme.py
State & Workflows
- View state · Stores per-tab session, page, zoom, and feature state.
src/neoview/models/view_state.py - Sidecar store · Persists annotations and bookmarks separately from source PDFs.
src/neoview/persistence/sidecar_store.py - Unit conversion
src/neoview/utils/units.py
Distribution
- Package definition · Exposes the installed neoview command.
pyproject.toml - Windows standalone build
neoview.spec - CI
.github/workflows/ci.yml
Connections 20
- Module entry point → Qt application bootstrap: starts
- Package definition → Module entry point: installs command for
- Qt application bootstrap → PySide6 desktop services: initializes
- Qt application bootstrap → Main window: creates
- Main window → PDF view: hosts per document tab
- Main window → View state: preserves tab state
- Main window → Sidecar store: loads and saves review state
- Main window → Document dialogs: launches
- Main window → Resources: uses
- Main window → Theme: applies
- PDF view → PyMuPDF: reads and renders PDFs
- PDF view → Page graphics: creates page graphics
- PDF view → Selection & measurement: captures selections
- PDF view → Annotation UI: displays annotations
- Selection & measurement → Unit conversion: converts measurements
- Selection & measurement → Annotation UI: creates annotations from
- Annotation toolbar → Annotation UI: controls
- Annotation UI → Sidecar store: persists review data
- Windows standalone build → Package definition: packages application
- CI → Package definition: validates