# clawsoftware/clawpdf architecture

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

- Interactive diagram: https://gitdiagram.com/clawsoftware/clawpdf
- Repository: https://github.com/clawsoftware/clawpdf

## Overview

clawPDF is a Windows virtual printer and document-conversion application. Its main user workflow is to print or submit a file, convert it to a selected document or image format, and optionally run post-processing actions such as encryption, emailing, FTP transfer, or scripting. The tree and README support these capability areas, but many implementation files were not sampled; the graph therefore omits uncertain internal calls and treats some subsystem paths as directory-level evidence.

Main entry points: [`src/clawPDF.Core/Jobs`](https://github.com/clawsoftware/clawpdf/tree/master/src/clawPDF.Core/Jobs) (Job lifecycle), [`src/clawPDF.Core/Actions/IAction.cs`](https://github.com/clawsoftware/clawpdf/blob/master/src/clawPDF.Core/Actions/IAction.cs) (Post-action interface), [`src/clawPDF/App.xaml.cs`](https://github.com/clawsoftware/clawpdf/blob/master/src/clawPDF/App.xaml.cs) (Desktop application), [`src/clawPDF.Core/Ghostscript/Ghostscript.cs`](https://github.com/clawsoftware/clawpdf/blob/master/src/clawPDF.Core/Ghostscript/Ghostscript.cs) (Ghostscript engine)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application and jobs"]
  node_app["Desktop application<br/>[App.xaml.cs]"]
  node_job["Job lifecycle<br/>[Jobs]"]
  node_jobfactory["Job factory<br/>[JobFactory.cs]"]
end

subgraph group_convert["Conversion and output"]
  node_ghostscript["Ghostscript engine<br/>[Ghostscript.cs]"]
  node_devices["Format output devices<br/>[OutputDevices]"]
  node_xps["XPS conversion<br/>[XpsConverter.cs]"]
  node_pdfprocess["PDF processing<br/>[PDFProcessor.cs]"]
end

subgraph group_actions["Post-processing"]
  node_actions["Post-action interface<br/>[IAction.cs]"]
  node_preprocess["PDF preprocessor<br/>[PDFPreprocessor.cs]"]
  node_encrypt["Encrypt and sign"]
  node_email["Email actions"]
  node_ftp["FTP action<br/>[FtpAction.cs]"]
  node_script["Script action<br/>[ScriptAction.cs]"]
  node_printing["Printing action<br/>[PrintingAction.cs]"]
end

subgraph group_config["Settings and integration"]
  node_settings["Profiles and settings"]
  node_pipe["Pipe client<br/>[PipeClient.cs]"]
  node_mailclient["Email clients"]
end

subgraph group_printer["Printer management"]
  node_setup["Printer setup helper<br/>[Program.cs]"]
  node_handler["Printer driver handler<br/>[PrinterHandler.cs]"]
  node_bridge["Network print bridge<br/>[Program.cs]"]
end

node_user(("Print user"))
node_spooler[("Windows print spooler")]

node_user -->|"submits print job"| node_app
node_app -->|"dispatches startup"| node_jobfactory
node_jobfactory -->|"creates job"| node_job
node_job -->|"uses profile"| node_settings
node_job -->|"converts document"| node_ghostscript
node_ghostscript -->|"selects output format"| node_devices
node_job -->|"converts XPS"| node_xps
node_job -->|"prepares PDF"| node_preprocess
node_job -->|"runs post-actions"| node_actions
node_actions -->|"encrypts or signs"| node_encrypt
node_actions -->|"starts email action"| node_email
node_email -->|"creates email client"| node_mailclient
node_actions -->|"transfers output"| node_ftp
node_actions -->|"runs script"| node_script
node_actions -->|"prints output"| node_printing
node_pdfprocess -.-> node_ghostscript
node_setup -->|"manages printer driver"| node_handler
node_user -->|"prints to virtual printer"| node_spooler
node_spooler -->|"delivers print job"| node_app
node_bridge -.->|"launches print process"| node_app
node_app -.->|"communicates over pipe"| node_pipe

click node_app "https://github.com/clawsoftware/clawpdf/blob/master/src/clawPDF/App.xaml.cs"
click node_job "https://github.com/clawsoftware/clawpdf/tree/master/src/clawPDF.Core/Jobs"
click node_jobfactory "https://github.com/clawsoftware/clawpdf/blob/master/src/clawPDF.Core/Jobs/JobFactory.cs"
click node_settings "https://github.com/clawsoftware/clawpdf/blob/master/src/clawPDF.Settings/ConversionProfile.cs"
click node_pipe "https://github.com/clawsoftware/clawpdf/blob/master/src/clawPDF.Utilities/Communication/PipeClient.cs"
click node_ghostscript "https://github.com/clawsoftware/clawpdf/blob/master/src/clawPDF.Core/Ghostscript/Ghostscript.cs"
click node_devices "https://github.com/clawsoftware/clawpdf/tree/master/src/clawPDF.Core/Ghostscript/OutputDevices"
click node_xps "https://github.com/clawsoftware/clawpdf/blob/master/src/clawPDF.Core/Xps/XpsConverter.cs"
click node_pdfprocess "https://github.com/clawsoftware/clawpdf/blob/master/src/PDFProcessor/PDFProcessor.cs"
click node_actions "https://github.com/clawsoftware/clawpdf/blob/master/src/clawPDF.Core/Actions/IAction.cs"
click node_preprocess "https://github.com/clawsoftware/clawpdf/blob/master/src/clawPDF.Core/Actions/PDFPreprocessor.cs"
click node_encrypt "https://github.com/clawsoftware/clawpdf/blob/master/src/clawPDF.Core/Actions/EncryptAndSignPdfAction.cs"
click node_email "https://github.com/clawsoftware/clawpdf/blob/master/src/clawPDF.Core/Actions/EMailClientAction.cs"
click node_ftp "https://github.com/clawsoftware/clawpdf/blob/master/src/clawPDF.Core/Actions/FtpAction.cs"
click node_script "https://github.com/clawsoftware/clawpdf/blob/master/src/clawPDF.Core/Actions/ScriptAction.cs"
click node_printing "https://github.com/clawsoftware/clawpdf/blob/master/src/clawPDF.Core/Actions/PrintingAction.cs"
click node_mailclient "https://github.com/clawsoftware/clawpdf/blob/master/src/clawPDF.Mail/EmailClientFactory.cs"
click node_setup "https://github.com/clawsoftware/clawpdf/blob/master/src/SetupHelper/Program.cs"
click node_handler "https://github.com/clawsoftware/clawpdf/blob/master/src/SetupHelper/Driver/PrinterHandler.cs"
click node_bridge "https://github.com/clawsoftware/clawpdf/blob/master/src/clawPDF.Bridge/Program.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_app,node_job,node_jobfactory,node_user toneBlue
class node_ghostscript,node_devices,node_xps,node_pdfprocess,node_spooler toneAmber
class node_actions,node_preprocess,node_encrypt,node_email,node_ftp,node_script,node_printing toneMint
class node_settings,node_pipe,node_mailclient toneRose
class node_setup,node_handler,node_bridge toneIndigo
```

## Components

### Application and jobs

- [Desktop application](https://github.com/clawsoftware/clawpdf/blob/master/src/clawPDF/App.xaml.cs): `src/clawPDF/App.xaml.cs`
- [Job lifecycle](https://github.com/clawsoftware/clawpdf/tree/master/src/clawPDF.Core/Jobs): `src/clawPDF.Core/Jobs`
- [Job factory](https://github.com/clawsoftware/clawpdf/blob/master/src/clawPDF.Core/Jobs/JobFactory.cs): `src/clawPDF.Core/Jobs/JobFactory.cs`

### Conversion and output

- [Ghostscript engine](https://github.com/clawsoftware/clawpdf/blob/master/src/clawPDF.Core/Ghostscript/Ghostscript.cs): `src/clawPDF.Core/Ghostscript/Ghostscript.cs`
- [Format output devices](https://github.com/clawsoftware/clawpdf/tree/master/src/clawPDF.Core/Ghostscript/OutputDevices): `src/clawPDF.Core/Ghostscript/OutputDevices`
- [XPS conversion](https://github.com/clawsoftware/clawpdf/blob/master/src/clawPDF.Core/Xps/XpsConverter.cs): `src/clawPDF.Core/Xps/XpsConverter.cs`
- [PDF processing](https://github.com/clawsoftware/clawpdf/blob/master/src/PDFProcessor/PDFProcessor.cs): `src/PDFProcessor/PDFProcessor.cs`

### Post-processing

- [Post-action interface](https://github.com/clawsoftware/clawpdf/blob/master/src/clawPDF.Core/Actions/IAction.cs): `src/clawPDF.Core/Actions/IAction.cs`
- [PDF preprocessor](https://github.com/clawsoftware/clawpdf/blob/master/src/clawPDF.Core/Actions/PDFPreprocessor.cs): `src/clawPDF.Core/Actions/PDFPreprocessor.cs`
- [Encrypt and sign](https://github.com/clawsoftware/clawpdf/blob/master/src/clawPDF.Core/Actions/EncryptAndSignPdfAction.cs): `src/clawPDF.Core/Actions/EncryptAndSignPdfAction.cs`
- [Email actions](https://github.com/clawsoftware/clawpdf/blob/master/src/clawPDF.Core/Actions/EMailClientAction.cs): `src/clawPDF.Core/Actions/EMailClientAction.cs`
- [FTP action](https://github.com/clawsoftware/clawpdf/blob/master/src/clawPDF.Core/Actions/FtpAction.cs): `src/clawPDF.Core/Actions/FtpAction.cs`
- [Script action](https://github.com/clawsoftware/clawpdf/blob/master/src/clawPDF.Core/Actions/ScriptAction.cs): `src/clawPDF.Core/Actions/ScriptAction.cs`
- [Printing action](https://github.com/clawsoftware/clawpdf/blob/master/src/clawPDF.Core/Actions/PrintingAction.cs): `src/clawPDF.Core/Actions/PrintingAction.cs`

### Settings and integration

- [Profiles and settings](https://github.com/clawsoftware/clawpdf/blob/master/src/clawPDF.Settings/ConversionProfile.cs): `src/clawPDF.Settings/ConversionProfile.cs`
- [Pipe client](https://github.com/clawsoftware/clawpdf/blob/master/src/clawPDF.Utilities/Communication/PipeClient.cs): `src/clawPDF.Utilities/Communication/PipeClient.cs`
- [Email clients](https://github.com/clawsoftware/clawpdf/blob/master/src/clawPDF.Mail/EmailClientFactory.cs): `src/clawPDF.Mail/EmailClientFactory.cs`

### Printer management

- [Printer setup helper](https://github.com/clawsoftware/clawpdf/blob/master/src/SetupHelper/Program.cs): `src/SetupHelper/Program.cs`
- [Printer driver handler](https://github.com/clawsoftware/clawpdf/blob/master/src/SetupHelper/Driver/PrinterHandler.cs): `src/SetupHelper/Driver/PrinterHandler.cs`
- [Network print bridge](https://github.com/clawsoftware/clawpdf/blob/master/src/clawPDF.Bridge/Program.cs): `src/clawPDF.Bridge/Program.cs`

### Other components

- **Print user**
- **Windows print spooler**

## Connections

- Print user → Desktop application: submits print job
- Desktop application → Job factory: dispatches startup
- Job factory → Job lifecycle: creates job
- Job lifecycle → Profiles and settings: uses profile
- Job lifecycle → Ghostscript engine: converts document
- Ghostscript engine → Format output devices: selects output format
- Job lifecycle → XPS conversion: converts XPS
- Job lifecycle → PDF preprocessor: prepares PDF
- Job lifecycle → Post-action interface: runs post-actions
- Post-action interface → Encrypt and sign: encrypts or signs
- Post-action interface → Email actions: starts email action
- Email actions → Email clients: creates email client
- Post-action interface → FTP action: transfers output
- Post-action interface → Script action: runs script
- Post-action interface → Printing action: prints output
- PDF processing → Ghostscript engine
- Printer setup helper → Printer driver handler: manages printer driver
- Print user → Windows print spooler: prints to virtual printer
- Windows print spooler → Desktop application: delivers print job
- Network print bridge → Desktop application: launches print process
- Desktop application → Pipe client: communicates over pipe
