# saepulloh07/pdf-wizard architecture

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

- Interactive diagram: https://gitdiagram.com/saepulloh07/pdf-wizard
- Repository: https://github.com/saepulloh07/pdf-wizard

## Overview

PDF Wizard is a native Rust PDF page arranger. Users open or append PDFs and images, arrange and edit pages in a thumbnail-based bench, then export PDFs without rasterizing page content. The README documents selection, transforms, extraction, splitting, booklet creation, metadata, and undo/redo. The app and renderer excerpts show thumbnail requests and blank-page creation; most detailed UI action wiring is not sampled, so those documented workflows are represented at the app boundary rather than as speculative call chains.

Main entry points: [`src/app.rs`](https://github.com/saepulloh07/pdf-wizard/blob/main/src/app.rs) (Document bench), [`src/main.rs`](https://github.com/saepulloh07/pdf-wizard/blob/main/src/main.rs) (App startup), [`src/pdf_engine.rs`](https://github.com/saepulloh07/pdf-wizard/blob/main/src/pdf_engine.rs) (PDF operations), [`src/renderer.rs`](https://github.com/saepulloh07/pdf-wizard/blob/main/src/renderer.rs) (Thumbnail renderer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Desktop interface"]
  node_app_entry["App startup<br/>[main.rs]"]
  node_bench["Document bench<br/>[app.rs]"]
end

subgraph group_editing["Page editing"]
  node_page_model["Page model<br/>[model.rs]"]
  node_page_arrangement["Page arrangement<br/>[arrange.rs]"]
  node_undo_history["Undo and redo<br/>[history.rs]"]
end

subgraph group_documents["PDF documents"]
  node_pdf_operations["PDF operations<br/>[pdf_engine.rs]"]
  node_thumbnail_renderer["Thumbnail renderer<br/>[renderer.rs]"]
  node_exported_pdf["Exported PDFs"]
end

subgraph group_presentation["Visual presentation"]
  node_theme["Theme and fonts<br/>[theme.rs]"]
  node_icon_glyphs["Icon glyphs<br/>[icons.rs]"]
end

node_user(("User"))
node_files["PDFs and images"]

node_user -->|"launches"| node_app_entry
node_app_entry -->|"starts"| node_bench
node_app_entry -->|"installs fonts"| node_theme
node_user -->|"opens and edits"| node_bench
node_files -->|"opens or appends"| node_bench
node_bench -->|"requests thumbnails"| node_thumbnail_renderer
node_thumbnail_renderer -->|"returns previews"| node_bench
node_bench -->|"creates blank page"| node_pdf_operations
node_bench -->|"exports edits"| node_pdf_operations
node_pdf_operations -->|"writes PDF"| node_exported_pdf
node_bench -.->|"uses page operations"| node_page_arrangement
node_bench -.->|"tracks edits"| node_undo_history
node_bench -.->|"uses styling"| node_theme
node_bench -.->|"uses icons"| node_icon_glyphs

click node_app_entry "https://github.com/saepulloh07/pdf-wizard/blob/main/src/main.rs"
click node_bench "https://github.com/saepulloh07/pdf-wizard/blob/main/src/app.rs"
click node_page_model "https://github.com/saepulloh07/pdf-wizard/blob/main/src/model.rs"
click node_page_arrangement "https://github.com/saepulloh07/pdf-wizard/blob/main/src/arrange.rs"
click node_undo_history "https://github.com/saepulloh07/pdf-wizard/blob/main/src/history.rs"
click node_pdf_operations "https://github.com/saepulloh07/pdf-wizard/blob/main/src/pdf_engine.rs"
click node_thumbnail_renderer "https://github.com/saepulloh07/pdf-wizard/blob/main/src/renderer.rs"
click node_theme "https://github.com/saepulloh07/pdf-wizard/blob/main/src/theme.rs"
click node_icon_glyphs "https://github.com/saepulloh07/pdf-wizard/blob/main/src/icons.rs"

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_app_entry,node_bench,node_user toneBlue
class node_page_model,node_page_arrangement,node_undo_history toneAmber
class node_pdf_operations,node_thumbnail_renderer,node_exported_pdf toneMint
class node_theme,node_icon_glyphs toneRose
class node_files toneIndigo
```

## Components

### Desktop interface

- [App startup](https://github.com/saepulloh07/pdf-wizard/blob/main/src/main.rs): `src/main.rs`
- [Document bench](https://github.com/saepulloh07/pdf-wizard/blob/main/src/app.rs): `src/app.rs`

### Page editing

- [Page model](https://github.com/saepulloh07/pdf-wizard/blob/main/src/model.rs): `src/model.rs`
- [Page arrangement](https://github.com/saepulloh07/pdf-wizard/blob/main/src/arrange.rs): `src/arrange.rs`
- [Undo and redo](https://github.com/saepulloh07/pdf-wizard/blob/main/src/history.rs): `src/history.rs`

### PDF documents

- [PDF operations](https://github.com/saepulloh07/pdf-wizard/blob/main/src/pdf_engine.rs): `src/pdf_engine.rs`
- [Thumbnail renderer](https://github.com/saepulloh07/pdf-wizard/blob/main/src/renderer.rs): `src/renderer.rs`
- **Exported PDFs**

### Visual presentation

- [Theme and fonts](https://github.com/saepulloh07/pdf-wizard/blob/main/src/theme.rs): `src/theme.rs`
- [Icon glyphs](https://github.com/saepulloh07/pdf-wizard/blob/main/src/icons.rs): `src/icons.rs`

### Other components

- **User**
- **PDFs and images**

## Connections

- User → App startup: launches (evidence: `README.md`)
- App startup → Document bench: starts (evidence: `src/main.rs`)
- App startup → Theme and fonts: installs fonts (evidence: `src/main.rs`)
- User → Document bench: opens and edits (evidence: `README.md`)
- PDFs and images → Document bench: opens or appends (evidence: `README.md`)
- Document bench → Thumbnail renderer: requests thumbnails (evidence: `src/app.rs`)
- Thumbnail renderer → Document bench: returns previews (evidence: `src/app.rs`)
- Document bench → PDF operations: creates blank page (evidence: `src/app.rs`)
- Document bench → PDF operations: exports edits (evidence: `README.md`)
- PDF operations → Exported PDFs: writes PDF (evidence: `README.md`)
- Document bench → Page arrangement: uses page operations (evidence: `src/app.rs`)
- Document bench → Undo and redo: tracks edits (evidence: `src/app.rs`)
- Document bench → Theme and fonts: uses styling (evidence: `src/app.rs`)
- Document bench → Icon glyphs: uses icons (evidence: `src/app.rs`)
