# pdfforge/pdfcreator architecture

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

- Interactive diagram: https://gitdiagram.com/pdfforge/pdfcreator
- Repository: https://github.com/pdfforge/pdfcreator

## Overview

1. **Product shape**
   PDFCreator is a Windows desktop application that behaves like a virtual printer. Print jobs arrive through the Windows print spooler and are turned into PDF or other output formats, then optionally routed to viewers, mail, cloud storage, FTP/HTTP endpoints, or other post-processing actions.

2. **Top-level solution boundaries**
   The repository is split into `Source/Application` for runtime code, `Source/Setup` for installer-related tooling, `Source/Languages` for gettext-based localization, `Source/WebViewer` for a separate viewer app, and a `COM Scripts` area with language-specific automation examples and test harnesses.

3. **Startup and edition entry points**
   `Source/Application/Startup` decides how the app is launched: normal UI startup, direct conversion, drag-and-drop, merge mode, print-file mode, or piped/queued startup. `Source/Application/Editions` contains edition-specific bootstraps, with `PDFCreator` being the main executable and `EditionBase` providing shared startup infrastructure.

4. **Core runtime orchestration**
   `Source/Application/Core` is the central runtime layer. It coordinates controller logic, job queues, workflow execution, printing integration, direct conversion, communication, service location, settings management, logging, licensing, update checks, usage statistics, and error reporting. Most higher-level features depend on this layer rather than talking directly to Windows or conversion engines.

5. **Job-centric architecture**
   The system is organized around a `Job`/`JobInfo` model. Incoming print jobs are represented, enriched with metadata, queued, and processed through workflow objects. The job pipeline is managed by components such as `JobInfoQueue`, `Workflow`, `JobRunner`, `JobBuilder`, and `JobCleanUp`, with progress and completion events exposed to the UI.

6. **Print-spooler and COM integration**
   There is a strong Windows integration boundary around printing and COM. `Core/Printing` handles printer discovery, ports, and print-command construction; `Core/ComImplementation` and `UI/COM` provide COM-facing adapters; `UI/ComWrapper` exposes wrapper objects for automation. This is how external apps and legacy scripts can drive PDFCreator.

7. **Conversion engine layer**
   `Source/Application/Conversion` contains the conversion subsystem. It includes abstract interfaces, a Ghostscript-based converter stack, PDF/text/image output devices, and helper code for merge, OCR-adjacent image handling, printing, and file conversion. Ghostscript is the main rendering/conversion backend, while iText-related interfaces support PDF manipulation tasks like signing, watermarking, stamping, encryption, page numbers, and merging.

8. **Action pipeline**
   A major architectural feature is the action framework under `Conversion/Actions`. Actions are composable steps applied to a job before or after conversion: cover, background, attachment, watermark, stamp, page numbers, signing, encryption, open-file, printing, scripting, mail, cloud upload, and forwarding to another profile. `ActionManager` and related helpers control ordering and execution.

9. **Profiles and settings**
   `Source/Application/Conversion/Settings` and `Source/Application/Core/SettingsManagement` define the profile-driven configuration model. Profiles describe output format, metadata, passwords, page layout, destination actions, and business features. Settings are loaded from persisted storage, upgraded across versions, optionally overridden by group policy, and surfaced through UI view models.

10. **Interactive WPF UI**
   `Source/Application/UI/Presentation` is the main WPF shell. It uses Prism and SimpleInjector for navigation and dependency injection, with a large MVVM surface composed of views, view models, commands, interactions, and overlays. The UI hosts the main shell, print-job shell, profile editor, settings pages, update prompts, feedback window, and specialized dialogs.

11. **Workflow and user interaction loop**
   The presentation layer wraps the core job workflow in interactive assistants. It handles password prompts, save/overwrite decisions, profile validation, quick actions, update notices, email collection hints, and error recovery. This layer bridges automated processing with user decisions when the workflow cannot proceed unattended.

12. **External services and integrations**
   Several subsystems connect outward: Dropbox, OneDrive, SharePoint, FTP/SFTP, HTTP upload endpoints, SMTP mail, Microsoft Graph/web mail, and Outlook COM attachment support. Additional infrastructure includes update downloads, usage statistics, Sentry-based error reporting, licensing checks, and RSS/feed content in the UI.

13. **Shared utility foundation**
   `Source/Application/Utilities` provides cross-cutting helpers for files, paths, tokens, registry, process launching, threading, Windows API calls, spooler repair, and update/user-guide support. Many higher-level modules depend on this package for environment-specific behavior and filesystem/process safety.

14. **Localization and packaging**
   `Source/Languages` holds translations in gettext `.po` files, which are consumed by the app’s translation helpers. `Source/Setup` contains helper code for installer/bootstrap scenarios, while the checked-in `nuget-feed` folder indicates the repo is designed to build mostly offline from pinned package artifacts.

15. **Ancillary tooling and examples**
   `COM Scripts` contains small samples in C#, VB.NET, C++, VBScript, JavaScript, Python, and VBA that demonstrate automation and conversion scenarios. These are not the core runtime, but they show the external integration surface the application exposes.

16. **Diagram takeaway**
   For an architecture diagram, the central flow is: Windows print job or launch command enters Startup/Controller → job is represented in Core workflow → settings/profile determine action chain and output format → conversion engine renders via Ghostscript/iText helpers → results are saved, printed, uploaded, mailed, opened, or otherwise dispatched → UI and services observe progress, errors, and completion.

Main entry points: [`Source/Application/Core`](https://github.com/pdfforge/pdfcreator/tree/master/Source/Application/Core) (Core), [`Source/Application/UI/Presentation`](https://github.com/pdfforge/pdfcreator/tree/master/Source/Application/UI/Presentation) (Presentation), [`Source/Application/Core/Workflow`](https://github.com/pdfforge/pdfcreator/tree/master/Source/Application/Core/Workflow) (Job Flow), [`Source/Application/Conversion/Actions`](https://github.com/pdfforge/pdfcreator/tree/master/Source/Application/Conversion/Actions) (Actions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_source_app["Application"]
  node_startup_entry["Startup<br/>launch routing"]
  node_edition_bootstrap["Editions<br/>edition bootstrap"]
  node_core_runtime["Core<br/>runtime orchestration"]
  node_job_pipeline["Job Flow<br/>job pipeline"]
  node_printing_boundary["Printing<br/>spooler integration"]
  node_com_bridge["COM Bridge<br/>automation bridge"]
  node_conversion_engine["Conversion"]
  node_actions_framework["Actions<br/>action pipeline"]
  node_ghostscript_backend["Ghostscript<br/>render backend"]
  node_pdf_processing["PDF Ops<br/>pdf helpers"]
  node_profile_settings["Profiles<br/>profile settings"]
  node_presentation_ui["Presentation<br/>WPF shell"]
  node_workflow_ui["Interactive Flow<br/>ui workflow"]
  node_com_ui["UI COM<br/>automation UI"]
  node_utilities["Utilities<br/>cross-cutting helpers"]
end

subgraph group_source_support["Support"]
  node_languages["Languages<br/>gettext localization"]
  node_setup_tools["Setup<br/>installer tooling"]
  node_web_viewer["WebViewer<br/>viewer app"]
end

subgraph group_scripts["Automation"]
  node_com_scripts["COM Scripts<br/>automation samples"]
end

node_startup_entry -->|"launches"| node_core_runtime
node_edition_bootstrap -->|"boots"| node_startup_entry
node_core_runtime -->|"orchestrates"| node_job_pipeline
node_core_runtime -->|"uses"| node_printing_boundary
node_core_runtime -->|"uses"| node_conversion_engine
node_core_runtime -->|"loads"| node_profile_settings
node_core_runtime -->|"depends on"| node_utilities
node_job_pipeline -->|"triggers"| node_conversion_engine
node_job_pipeline -->|"applies"| node_actions_framework
node_job_pipeline -->|"reports to"| node_presentation_ui
node_printing_boundary -->|"creates jobs"| node_job_pipeline
node_com_bridge -->|"adapts"| node_job_pipeline
node_presentation_ui -->|"hosts"| node_workflow_ui
node_workflow_ui -->|"guides"| node_job_pipeline
node_presentation_ui -->|"edits"| node_profile_settings
node_presentation_ui -->|"uses"| node_utilities
node_actions_framework -->|"uses"| node_pdf_processing
node_actions_framework -->|"configures"| node_core_runtime
node_ghostscript_backend -->|"implements"| node_conversion_engine
node_pdf_processing -->|"supports"| node_ghostscript_backend
node_presentation_ui -->|"exposes"| node_com_ui
node_languages -.->|"localizes"| node_presentation_ui
node_setup_tools -.->|"supports"| node_core_runtime
node_web_viewer -.->|"pairs with"| node_presentation_ui
node_com_scripts -.->|"drives"| node_com_bridge

click node_startup_entry "https://github.com/pdfforge/pdfcreator/tree/master/Source/Application/Startup"
click node_edition_bootstrap "https://github.com/pdfforge/pdfcreator/tree/master/Source/Application/Editions"
click node_core_runtime "https://github.com/pdfforge/pdfcreator/tree/master/Source/Application/Core"
click node_job_pipeline "https://github.com/pdfforge/pdfcreator/tree/master/Source/Application/Core/Workflow"
click node_printing_boundary "https://github.com/pdfforge/pdfcreator/tree/master/Source/Application/Core/Printing"
click node_com_bridge "https://github.com/pdfforge/pdfcreator/tree/master/Source/Application/Core/ComImplementation"
click node_conversion_engine "https://github.com/pdfforge/pdfcreator/tree/master/Source/Application/Conversion"
click node_actions_framework "https://github.com/pdfforge/pdfcreator/tree/master/Source/Application/Conversion/Actions"
click node_ghostscript_backend "https://github.com/pdfforge/pdfcreator/tree/master/Source/Application/Conversion/Ghostscript"
click node_pdf_processing "https://github.com/pdfforge/pdfcreator/tree/master/Source/Application/Conversion/Processing"
click node_profile_settings "https://github.com/pdfforge/pdfcreator/tree/master/Source/Application/Conversion/Settings"
click node_presentation_ui "https://github.com/pdfforge/pdfcreator/tree/master/Source/Application/UI/Presentation"
click node_workflow_ui "https://github.com/pdfforge/pdfcreator/tree/master/Source/Application/UI/Presentation/Workflow"
click node_com_ui "https://github.com/pdfforge/pdfcreator/tree/master/Source/Application/UI/COM"
click node_utilities "https://github.com/pdfforge/pdfcreator/tree/master/Source/Application/Utilities"
click node_languages "https://github.com/pdfforge/pdfcreator/tree/master/Source/Languages"
click node_setup_tools "https://github.com/pdfforge/pdfcreator/tree/master/Source/Setup"
click node_web_viewer "https://github.com/pdfforge/pdfcreator/tree/master/Source/WebViewer"
click node_com_scripts "https://github.com/pdfforge/pdfcreator/tree/master/COM Scripts"

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_startup_entry,node_edition_bootstrap,node_core_runtime,node_job_pipeline,node_printing_boundary,node_com_bridge,node_conversion_engine,node_actions_framework,node_ghostscript_backend,node_pdf_processing,node_profile_settings,node_presentation_ui,node_workflow_ui,node_com_ui,node_utilities toneBlue
class node_languages,node_setup_tools,node_web_viewer toneAmber
class node_com_scripts toneMint
```

## Components

### Application

Runtime code for startup, core orchestration, conversion, workflow, UI, and shared utilities.

- [Startup](https://github.com/pdfforge/pdfcreator/tree/master/Source/Application/Startup): launch routing · Selects launch mode and checks startup conditions for print jobs, direct conversion, drag-drop, merge, and piped startup. · `Source/Application/Startup`
- [Editions](https://github.com/pdfforge/pdfcreator/tree/master/Source/Application/Editions): edition bootstrap · Edition-specific startup entry points and shared bootstrap infrastructure. · `Source/Application/Editions`
- [Core](https://github.com/pdfforge/pdfcreator/tree/master/Source/Application/Core): runtime orchestration · Central coordination layer for controllers, jobs, printing, communication, settings, licensing, logging, updates, statistics, and errors. · `Source/Application/Core`
- [Job Flow](https://github.com/pdfforge/pdfcreator/tree/master/Source/Application/Core/Workflow): job pipeline · JobInfo-centric queueing, workflow execution, job building, cleanup, and completion/progress handling. · `Source/Application/Core/Workflow`
- [Printing](https://github.com/pdfforge/pdfcreator/tree/master/Source/Application/Core/Printing): spooler integration · Windows printer discovery, print-command construction, spooler repair, and print-file handling. · `Source/Application/Core/Printing`
- [COM Bridge](https://github.com/pdfforge/pdfcreator/tree/master/Source/Application/Core/ComImplementation): automation bridge · COM-facing adapters and workflow factories for legacy scripts and external automation. · `Source/Application/Core/ComImplementation`
- [Conversion](https://github.com/pdfforge/pdfcreator/tree/master/Source/Application/Conversion): render/conversion · Conversion subsystem for Ghostscript rendering, PDF/text/image output, and file conversion helpers. · `Source/Application/Conversion`
- [Actions](https://github.com/pdfforge/pdfcreator/tree/master/Source/Application/Conversion/Actions): action pipeline · Composable pre- and post-conversion actions such as watermarking, signing, encryption, mail, upload, printing, and forwarding. · `Source/Application/Conversion/Actions`
- [Ghostscript](https://github.com/pdfforge/pdfcreator/tree/master/Source/Application/Conversion/Ghostscript): render backend · Ghostscript discovery and converter stack with output devices for PDF, text, images, and print. · `Source/Application/Conversion/Ghostscript`
- [PDF Ops](https://github.com/pdfforge/pdfcreator/tree/master/Source/Application/Conversion/Processing): pdf helpers · PDF manipulation interfaces and helpers for signing, watermarking, page numbers, image-to-PDF, and merging. · `Source/Application/Conversion/Processing`
- [Profiles](https://github.com/pdfforge/pdfcreator/tree/master/Source/Application/Conversion/Settings): profile settings · Profile-driven configuration, settings persistence, migrations, GPO overrides, and output/action metadata. · `Source/Application/Conversion/Settings`
- [Presentation](https://github.com/pdfforge/pdfcreator/tree/master/Source/Application/UI/Presentation): WPF shell · Main WPF MVVM shell with Prism/SimpleInjector navigation, dialogs, overlays, and workflow-driven user interaction. · `Source/Application/UI/Presentation`
- [Interactive Flow](https://github.com/pdfforge/pdfcreator/tree/master/Source/Application/UI/Presentation/Workflow): ui workflow · Interactive assistants and steps that bridge unattended processing with prompts, passwords, overwrite decisions, and errors. · `Source/Application/UI/Presentation/Workflow`
- [UI COM](https://github.com/pdfforge/pdfcreator/tree/master/Source/Application/UI/COM): automation UI · UI-layer COM adapters and wrapper objects exposed to automation clients. · `Source/Application/UI/COM`
- [Utilities](https://github.com/pdfforge/pdfcreator/tree/master/Source/Application/Utilities): cross-cutting helpers · Filesystem, process, registry, threading, tokens, Windows API, update, and user-guide helpers used across the app. · `Source/Application/Utilities`

### Support

Installer, localization, and auxiliary viewer app.

- [Languages](https://github.com/pdfforge/pdfcreator/tree/master/Source/Languages): gettext localization · Translation catalogs and localization assets consumed by the application. · `Source/Languages`
- [Setup](https://github.com/pdfforge/pdfcreator/tree/master/Source/Setup): installer tooling · Installer/bootstrap helper code for setup-related scenarios. · `Source/Setup`
- [WebViewer](https://github.com/pdfforge/pdfcreator/tree/master/Source/WebViewer): viewer app · Separate viewer application boundary for PDF viewing. · `Source/WebViewer`

### Automation

COM automation examples and harnesses.

- [COM Scripts](https://github.com/pdfforge/pdfcreator/tree/HEAD/COM%20Scripts): automation samples · Language-specific examples and test harnesses demonstrating COM automation and conversion scenarios. · `COM Scripts`

## Connections

- Startup → Core: launches · Startup hands off resolved launch modes to the runtime orchestration layer.
- Editions → Startup: boots · Edition-specific executables initialize startup behavior through shared bootstrap infrastructure.
- Core → Job Flow: orchestrates · Core coordinates the job lifecycle and workflow execution.
- Core → Printing: uses · Core integrates with Windows printing and spooler management.
- Core → Conversion: uses · Core delegates conversion tasks to the conversion subsystem.
- Core → Profiles: loads · Core reads and upgrades profile-driven settings.
- Core → Utilities: depends on · Core relies on shared environment and filesystem helpers.
- Job Flow → Conversion: triggers · Jobs are converted as they move through the workflow.
- Job Flow → Actions: applies · Workflow invokes configured actions around conversion.
- Job Flow → Presentation: reports to · Workflow publishes progress, completion, and failure state to the UI.
- Printing → Job Flow: creates jobs · Incoming spooler jobs are turned into workflow jobs.
- COM Bridge → Job Flow: adapts · COM automation routes requests into the same job pipeline.
- Presentation → Interactive Flow: hosts · The shell hosts interactive workflow assistants and step views.
- Interactive Flow → Job Flow: guides · Interactive steps guide or unblock the underlying job flow.
- Presentation → Profiles: edits · The UI surfaces profiles and application settings.
- Presentation → Utilities: uses · UI helpers depend on shared process, path, and launcher utilities.
- Actions → PDF Ops: uses · Many actions rely on PDF manipulation helpers and interfaces.
- Actions → Core: configures · Action ordering and execution are controlled through runtime services and settings.
- Ghostscript → Conversion: implements · Ghostscript provides the primary rendering backend for conversion.
- PDF Ops → Ghostscript: supports · PDF helpers complement rendering and output-device workflows.
- Presentation → UI COM: exposes · The UI layer provides COM-visible wrappers and adapters.
- Languages → Presentation: localizes · Translation catalogs feed the WPF presentation layer.
- Setup → Core: supports · Setup tooling supports installation/bootstrap flows around the runtime.
- WebViewer → Presentation: pairs with · The viewer app is a separate UI boundary used alongside the main application.
- COM Scripts → COM Bridge: drives · Automation samples demonstrate the COM integration surface.
