How pdfforge/pdfcreator works
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: Core Core · Presentation Presentation · Workflow Job Flow · Actions Actions
Components 19
Application
Runtime code for startup, core orchestration, conversion, workflow, UI, and shared utilities.
- Startup · Selects launch mode and checks startup conditions for print jobs, direct conversion, drag-drop, merge, and piped startup.
Source/Application/Startup - Editions · Edition-specific startup entry points and shared bootstrap infrastructure.
Source/Application/Editions - Core · Central coordination layer for controllers, jobs, printing, communication, settings, licensing, logging, updates, statistics, and errors.
Source/Application/Core - Job Flow · JobInfo-centric queueing, workflow execution, job building, cleanup, and completion/progress handling.
Source/Application/Core/Workflow - Printing · Windows printer discovery, print-command construction, spooler repair, and print-file handling.
Source/Application/Core/Printing - COM Bridge · COM-facing adapters and workflow factories for legacy scripts and external automation.
Source/Application/Core/ComImplementation - Conversion · Conversion subsystem for Ghostscript rendering, PDF/text/image output, and file conversion helpers.
Source/Application/Conversion - Actions · Composable pre- and post-conversion actions such as watermarking, signing, encryption, mail, upload, printing, and forwarding.
Source/Application/Conversion/Actions - Ghostscript · Ghostscript discovery and converter stack with output devices for PDF, text, images, and print.
Source/Application/Conversion/Ghostscript - PDF Ops · PDF manipulation interfaces and helpers for signing, watermarking, page numbers, image-to-PDF, and merging.
Source/Application/Conversion/Processing - Profiles · Profile-driven configuration, settings persistence, migrations, GPO overrides, and output/action metadata.
Source/Application/Conversion/Settings - Presentation · Main WPF MVVM shell with Prism/SimpleInjector navigation, dialogs, overlays, and workflow-driven user interaction.
Source/Application/UI/Presentation - Interactive Flow · Interactive assistants and steps that bridge unattended processing with prompts, passwords, overwrite decisions, and errors.
Source/Application/UI/Presentation/Workflow - UI COM · UI-layer COM adapters and wrapper objects exposed to automation clients.
Source/Application/UI/COM - Utilities · 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.
Automation
COM automation examples and harnesses.
- COM Scripts · Language-specific examples and test harnesses demonstrating COM automation and conversion scenarios.
COM Scripts
Connections 25
- 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.