# skin4ik123/nexuspdf architecture

> Architecture diagram of the GitHub repository skin4ik123/nexuspdf, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/skin4ik123/nexuspdf
- Repository: https://github.com/skin4ik123/nexuspdf

## Overview

NexusPDF is a local-first Windows desktop PDF editor with a batch CLI. The main user workflow is opening a PDF, working with its logical page session through the MuPDF-backed document engine, then saving or exporting the result. Distinct capability branches cover scan/OCR, document editing, conversion, signing, and print planning. The graph uses the README for product capabilities and the SOURCE INDEX for sampled dependencies; several feature implementations were not excerpted, so their internal call paths are not asserted.

Main entry points: [`src/NexusPdf.Application/OpenedDocument.cs`](https://github.com/skin4ik123/nexuspdf/blob/main/src/NexusPdf.Application/OpenedDocument.cs) (Opened document), [`src/NexusPdf.App.Desktop/Services/AppServices.cs`](https://github.com/skin4ik123/nexuspdf/blob/main/src/NexusPdf.App.Desktop/Services/AppServices.cs) (Service wiring), [`src/NexusPdf.Pdf.MuPdf/Engine/MuPdfRenderEngine.cs`](https://github.com/skin4ik123/nexuspdf/blob/main/src/NexusPdf.Pdf.MuPdf/Engine/MuPdfRenderEngine.cs) (MuPDF engine), [`src/NexusPdf.Application/SaveService.cs`](https://github.com/skin4ik123/nexuspdf/blob/main/src/NexusPdf.Application/SaveService.cs) (Save workflow)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop experience"]
  node_desktop_app["Desktop app<br/>[App.xaml.cs]"]
  node_main_vm["Workspace UI<br/>[MainViewModel.cs]"]
  node_app_services["Service wiring<br/>[AppServices.cs]"]
  node_cli["Batch CLI<br/>[Program.cs]"]
end

subgraph group_application["Document workflows"]
  node_pipeline["Document pipeline"]
  node_opened["Opened document<br/>[OpenedDocument.cs]"]
  node_session["Document session<br/>[DocumentSession.cs]"]
  node_save["Save workflow<br/>[SaveService.cs]"]
  node_tools["Document tools"]
  node_search["Text search<br/>[SearchService.cs]"]
end

subgraph group_engine["PDF engine"]
  node_pdf_engine["MuPDF engine"]
  node_engine_api["PDF engine API"]
  node_engine_handle["PDF document handle"]
end

subgraph group_features["PDF capabilities"]
  node_scan["Scan cleanup"]
  node_ocr["OCR services<br/>[OcrService.cs]"]
  node_ocr_engines["OCR engines<br/>[ITextRecognizer.cs]"]
  node_export["Word and Excel export<br/>[NexusPdf.Export]"]
  node_printing["Print planning"]
  node_signing["Digital signatures"]
  node_qpdf["QPDF operations<br/>[QpdfEngine.cs]"]
end

subgraph group_platform["Local integrations"]
  node_local_files[("Local files")]
  node_windows_print["Windows printers"]
end

node_user(("PDF user"))

node_user -->|"opens and edits"| node_desktop_app
node_desktop_app -->|"configures"| node_app_services
node_app_services -->|"creates"| node_pdf_engine
node_app_services -->|"creates"| node_save
node_app_services -->|"creates"| node_tools
node_desktop_app -.->|"hosts"| node_main_vm
node_main_vm -.->|"invokes"| node_pipeline
node_pipeline -->|"coordinates"| node_opened
node_opened -->|"maintains"| node_session
node_opened -->|"opens sources"| node_pdf_engine
node_pipeline -->|"uses"| node_save
node_cli -->|"opens documents"| node_opened
node_cli -->|"uses"| node_save
node_pdf_engine -->|"implements"| node_engine_api
node_pdf_engine -->|"creates"| node_engine_handle
node_opened -->|"supports search"| node_search
node_user -->|"cleans scans"| node_scan
node_user -->|"recognizes text"| node_ocr
node_ocr -.->|"uses recognizers"| node_ocr_engines
node_user -->|"exports documents"| node_export
node_user -->|"plans print jobs"| node_printing
node_printing -.->|"prints to"| node_windows_print
node_user -->|"signs documents"| node_signing
node_user -->|"protects documents"| node_qpdf
node_opened -.->|"reads sources"| node_local_files
node_save -.->|"writes results"| node_local_files

click node_desktop_app "https://github.com/skin4ik123/nexuspdf/blob/main/src/NexusPdf.App.Desktop/App.xaml.cs"
click node_main_vm "https://github.com/skin4ik123/nexuspdf/blob/main/src/NexusPdf.App.Desktop/ViewModels/MainViewModel.cs"
click node_app_services "https://github.com/skin4ik123/nexuspdf/blob/main/src/NexusPdf.App.Desktop/Services/AppServices.cs"
click node_cli "https://github.com/skin4ik123/nexuspdf/blob/main/src/NexusPdf.Cli/Program.cs"
click node_pipeline "https://github.com/skin4ik123/nexuspdf/blob/main/src/NexusPdf.Application/DocumentPipeline.cs"
click node_opened "https://github.com/skin4ik123/nexuspdf/blob/main/src/NexusPdf.Application/OpenedDocument.cs"
click node_session "https://github.com/skin4ik123/nexuspdf/blob/main/src/NexusPdf.Domain/DocumentSession.cs"
click node_save "https://github.com/skin4ik123/nexuspdf/blob/main/src/NexusPdf.Application/SaveService.cs"
click node_tools "https://github.com/skin4ik123/nexuspdf/blob/main/src/NexusPdf.Application/DocumentToolsService.cs"
click node_search "https://github.com/skin4ik123/nexuspdf/blob/main/src/NexusPdf.Application/SearchService.cs"
click node_pdf_engine "https://github.com/skin4ik123/nexuspdf/blob/main/src/NexusPdf.Pdf.MuPdf/Engine/MuPdfRenderEngine.cs"
click node_engine_api "https://github.com/skin4ik123/nexuspdf/blob/main/src/NexusPdf.Pdf.Abstractions/IPdfRenderEngine.cs"
click node_engine_handle "https://github.com/skin4ik123/nexuspdf/blob/main/src/NexusPdf.Pdf.MuPdf/Engine/MuPdfDocumentHandle.cs"
click node_scan "https://github.com/skin4ik123/nexuspdf/blob/main/src/NexusPdf.Pdf.MuPdf/Engine/MuPdfScanEnhancer.cs"
click node_ocr "https://github.com/skin4ik123/nexuspdf/blob/main/src/NexusPdf.Application/OcrService.cs"
click node_ocr_engines "https://github.com/skin4ik123/nexuspdf/blob/main/src/NexusPdf.Ocr/ITextRecognizer.cs"
click node_export "https://github.com/skin4ik123/nexuspdf/tree/main/src/NexusPdf.Export"
click node_printing "https://github.com/skin4ik123/nexuspdf/blob/main/src/NexusPdf.Printing/PrintLayoutEngine.cs"
click node_signing "https://github.com/skin4ik123/nexuspdf/blob/main/src/NexusPdf.Signing/PdfIncrementalSigner.cs"
click node_qpdf "https://github.com/skin4ik123/nexuspdf/blob/main/src/NexusPdf.Pdf.Qpdf/QpdfEngine.cs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_desktop_app,node_main_vm,node_app_services,node_cli,node_user toneBlue
class node_pipeline,node_opened,node_session,node_save,node_tools,node_search toneAmber
class node_pdf_engine,node_engine_api,node_engine_handle toneMint
class node_scan,node_ocr,node_ocr_engines,node_export,node_printing,node_signing,node_qpdf toneRose
class node_local_files,node_windows_print toneIndigo
```

## Components

### Desktop experience

- [Desktop app](https://github.com/skin4ik123/nexuspdf/blob/main/src/NexusPdf.App.Desktop/App.xaml.cs): `src/NexusPdf.App.Desktop/App.xaml.cs`
- [Workspace UI](https://github.com/skin4ik123/nexuspdf/blob/main/src/NexusPdf.App.Desktop/ViewModels/MainViewModel.cs): `src/NexusPdf.App.Desktop/ViewModels/MainViewModel.cs`
- [Service wiring](https://github.com/skin4ik123/nexuspdf/blob/main/src/NexusPdf.App.Desktop/Services/AppServices.cs): `src/NexusPdf.App.Desktop/Services/AppServices.cs`
- [Batch CLI](https://github.com/skin4ik123/nexuspdf/blob/main/src/NexusPdf.Cli/Program.cs): `src/NexusPdf.Cli/Program.cs`

### Document workflows

- [Document pipeline](https://github.com/skin4ik123/nexuspdf/blob/main/src/NexusPdf.Application/DocumentPipeline.cs): `src/NexusPdf.Application/DocumentPipeline.cs`
- [Opened document](https://github.com/skin4ik123/nexuspdf/blob/main/src/NexusPdf.Application/OpenedDocument.cs): `src/NexusPdf.Application/OpenedDocument.cs`
- [Document session](https://github.com/skin4ik123/nexuspdf/blob/main/src/NexusPdf.Domain/DocumentSession.cs): `src/NexusPdf.Domain/DocumentSession.cs`
- [Save workflow](https://github.com/skin4ik123/nexuspdf/blob/main/src/NexusPdf.Application/SaveService.cs): `src/NexusPdf.Application/SaveService.cs`
- [Document tools](https://github.com/skin4ik123/nexuspdf/blob/main/src/NexusPdf.Application/DocumentToolsService.cs): `src/NexusPdf.Application/DocumentToolsService.cs`
- [Text search](https://github.com/skin4ik123/nexuspdf/blob/main/src/NexusPdf.Application/SearchService.cs): `src/NexusPdf.Application/SearchService.cs`

### PDF engine

- [MuPDF engine](https://github.com/skin4ik123/nexuspdf/blob/main/src/NexusPdf.Pdf.MuPdf/Engine/MuPdfRenderEngine.cs): `src/NexusPdf.Pdf.MuPdf/Engine/MuPdfRenderEngine.cs`
- [PDF engine API](https://github.com/skin4ik123/nexuspdf/blob/main/src/NexusPdf.Pdf.Abstractions/IPdfRenderEngine.cs): `src/NexusPdf.Pdf.Abstractions/IPdfRenderEngine.cs`
- [PDF document handle](https://github.com/skin4ik123/nexuspdf/blob/main/src/NexusPdf.Pdf.MuPdf/Engine/MuPdfDocumentHandle.cs): `src/NexusPdf.Pdf.MuPdf/Engine/MuPdfDocumentHandle.cs`

### PDF capabilities

- [Scan cleanup](https://github.com/skin4ik123/nexuspdf/blob/main/src/NexusPdf.Pdf.MuPdf/Engine/MuPdfScanEnhancer.cs): `src/NexusPdf.Pdf.MuPdf/Engine/MuPdfScanEnhancer.cs`
- [OCR services](https://github.com/skin4ik123/nexuspdf/blob/main/src/NexusPdf.Application/OcrService.cs): `src/NexusPdf.Application/OcrService.cs`
- [OCR engines](https://github.com/skin4ik123/nexuspdf/blob/main/src/NexusPdf.Ocr/ITextRecognizer.cs): `src/NexusPdf.Ocr/ITextRecognizer.cs`
- [Word and Excel export](https://github.com/skin4ik123/nexuspdf/tree/main/src/NexusPdf.Export): `src/NexusPdf.Export`
- [Print planning](https://github.com/skin4ik123/nexuspdf/blob/main/src/NexusPdf.Printing/PrintLayoutEngine.cs): `src/NexusPdf.Printing/PrintLayoutEngine.cs`
- [Digital signatures](https://github.com/skin4ik123/nexuspdf/blob/main/src/NexusPdf.Signing/PdfIncrementalSigner.cs): `src/NexusPdf.Signing/PdfIncrementalSigner.cs`
- [QPDF operations](https://github.com/skin4ik123/nexuspdf/blob/main/src/NexusPdf.Pdf.Qpdf/QpdfEngine.cs): `src/NexusPdf.Pdf.Qpdf/QpdfEngine.cs`

### Local integrations

- **Local files**
- **Windows printers**

### Other components

- **PDF user**

## Connections

- PDF user → Desktop app: opens and edits
- Desktop app → Service wiring: configures (evidence: `src/NexusPdf.App.Desktop/App.xaml.cs`)
- Service wiring → MuPDF engine: creates (evidence: `src/NexusPdf.App.Desktop/Services/AppServices.cs`)
- Service wiring → Save workflow: creates (evidence: `src/NexusPdf.App.Desktop/Services/AppServices.cs`)
- Service wiring → Document tools: creates (evidence: `src/NexusPdf.App.Desktop/Services/AppServices.cs`)
- Desktop app → Workspace UI: hosts
- Workspace UI → Document pipeline: invokes
- Document pipeline → Opened document: coordinates (evidence: `src/NexusPdf.Application/DocumentPipeline.cs`)
- Opened document → Document session: maintains (evidence: `src/NexusPdf.Application/OpenedDocument.cs`)
- Opened document → MuPDF engine: opens sources (evidence: `src/NexusPdf.Application/OpenedDocument.cs`)
- Document pipeline → Save workflow: uses (evidence: `src/NexusPdf.Application/DocumentPipeline.cs`)
- Batch CLI → Opened document: opens documents (evidence: `src/NexusPdf.Cli/Program.cs`)
- Batch CLI → Save workflow: uses (evidence: `src/NexusPdf.Cli/Program.cs`)
- MuPDF engine → PDF engine API: implements (evidence: `src/NexusPdf.Pdf.MuPdf/Engine/MuPdfRenderEngine.cs`)
- MuPDF engine → PDF document handle: creates (evidence: `src/NexusPdf.Pdf.MuPdf/Engine/MuPdfRenderEngine.cs`)
- Opened document → Text search: supports search (evidence: `src/NexusPdf.Application/SearchService.cs`)
- PDF user → Scan cleanup: cleans scans
- PDF user → OCR services: recognizes text
- OCR services → OCR engines: uses recognizers
- PDF user → Word and Excel export: exports documents
- PDF user → Print planning: plans print jobs
- Print planning → Windows printers: prints to
- PDF user → Digital signatures: signs documents
- PDF user → QPDF operations: protects documents
- Opened document → Local files: reads sources
- Save workflow → Local files: writes results
