Skip to content

About

Virtual PDF printer for Windows (AGPL) - print to PDF and hand it to a configurable target application. Based on clawPDF/mfilemon, uses Ghostscript.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

miPDFconvert logo

miPDFconvert

GitHub release License: AGPL v3 winget Chocolatey

A virtual PDF printer for Windows. Install it and a new printer named miPDFconvert appears in Windows. Anything you print to it is converted to a PDF, which is then either handed to a configurable target application or offered to you through a Save As dialog.

miPDFconvert is a derivative work of clawPDF (and, through it, PDFCreator) and uses the mfilemon print port monitor. It is released under the GNU AGPL v3 — see Licensing.

How it works

Application  ──►  "miPDFconvert" printer  ──►  print port monitor (miPortMon)
                                                        │  PostScript spool file
                                                        ▼
                                          miPDFconvertBase (launcher)
                                                        │
                                                        ▼
                                   miPDFconvert  ──►  Ghostscript  ──►  PDF
                                                        │
                        ┌───────────────────────────────┴───────────────────────────────┐
                        ▼                                                               ▼
        TARGET_APPLICATION is set:                                     TARGET_APPLICATION is empty:
        the PDF is passed to that app                                  a "Save As" dialog is shown

Requirements

  • Windows 10/11 (x64 or ARM64).
  • .NET 8 Desktop Runtime (bundled/installed by the setup if missing).

Ghostscript is included — since version 1.1.0 the installer ships the unmodified Ghostscript binaries (AGPL release by Artifex) in a private folder (<install dir>\gs), so nothing has to be installed separately. The 64-bit build is used on x64/ARM64, the 32-bit build elsewhere. If the bundled copy is missing (e.g. when running a development build), miPDFconvert falls back to a Ghostscript installed on the system (32- or 64-bit). No Visual C++ Redistributable is required either: the print monitor DLLs link the C runtime statically and Ghostscript ships with its runtime DLLs.

Installation

Via package manager

winget:

winget install mipdfconvert

Chocolatey:

choco install mipdfconvert

Ghostscript is bundled — no separate installation needed. Newly submitted versions can take a few days to appear while they pass winget/Chocolatey moderation.

Manual

  1. Run the installer miPDFconvertSetup.exe. During setup you can optionally choose a target application that should automatically receive the generated PDF — the selected path is written to TARGET_APPLICATION in miPDFconvert.dll.config (leave it empty for a Save As dialog; changeable later).
  2. Print to the miPDFconvert printer from any application.

Configuration

Settings live in miPDFconvert.dll.config (next to miPDFconvert.exe in the install directory), under <appSettings>:

Key Default Description
TARGET_APPLICATION (empty) Path or name of an application that should automatically receive the generated PDF as a command-line argument. A relative path/bare file name is resolved against the install directory first. Leave empty to get a Save As dialog instead.
CREATE_DOCUMENT_FILES false If true, keep the temporary PostScript file in %TEMP%.
PDF_SETTINGS /printer Ghostscript quality preset: /printer (300 dpi, fast), /prepress (max quality/size), /ebook (150 dpi), /screen (72 dpi, smallest).

Defining a target application

Set TARGET_APPLICATION to the program that should open the freshly created PDF. The PDF is written to a temporary file and passed as the first argument, so anything that accepts a file path works — for example a PDF viewer, an archiving tool, or your own application:

<add key="TARGET_APPLICATION" value="C:\Program Files\YourApp\YourApp.exe" />

The installer also offers an optional page to pick a target application; the chosen path is written to this setting during installation (leave it empty for the Save As dialog).

The target application is brought to the foreground automatically (including single-instance apps such as browser-based viewers). If TARGET_APPLICATION is empty, miPDFconvert falls back to a Save As dialog.

Building from source

Prerequisites:

  • Visual Studio 2022 Build Tools with the C++ (v145) toolset (for the native print monitor) and the .NET desktop workload. Override with -PlatformToolset if you have a different version installed (e.g. v143/v144).
  • .NET 8 SDK.
  • Inno Setup 6 — https://jrsoftware.org/isdl.php (for building the installer).
  • 7-Zip — https://www.7-zip.org (to extract the Ghostscript binaries from the official Artifex installers).

Build everything (native DLLs → SetupHelper → apps → installer) with the included script:

.\build.ps1

Useful switches: -SkipNative (skip the C++ projects), -SkipSetup (binaries only), -PlatformToolset v144 (override the C++ toolset). The finished installer is written to miPDFconvertSetup\Release\miPDFconvertSetup.exe.

Microsoft PostScript driver files: The virtual printer uses Microsoft's inbox PostScript class driver (pscript5.dll, ps5ui.dll, pscript.hlp, pscript.ntf). These are not redistributed in this repository — build.ps1 copies them from the local Windows driver store into lib\miMonitor\... automatically before packaging the installer. Only the project's own ghostpdf.ppd is tracked in the repository.

Ghostscript: build.ps1 downloads the official Ghostscript Windows installers and the source tarball for the version pinned at the top of the script, verifies their SHA256 hashes, and extracts only gswinXXc.exe + gsdllXX.dll (init files and fonts are compiled in) plus the license into build\ghostscript. The app-local Visual C++ runtime DLLs are taken from the Visual Studio Redist folder. To update Ghostscript (e.g. for a security fix), change the version, tag and hashes in build.ps1 and rebuild.

Code signing (optional)

Release builds can be Authenticode-signed; signing is off by default. To sign the project's own binaries and the installer (with timestamp):

$env:MIPDF_SIGN_SUBJECT = "Your certificate subject (CN)"
.\build.ps1 -Sign

The certificate subject is taken from -SignSubject or the MIPDF_SIGN_SUBJECT environment variable and is intentionally not stored in the repository. Signing uses signtool.exe (auto-located from the Windows SDK) and the Certum timestamp server. The installer and uninstaller are signed by Inno Setup through a sign tool named certum that must be configured locally (Inno Setup IDE → Tools → Configure Sign Tools); build.ps1 -Sign activates it by passing /DSIGN to ISCC.

Logging

A runtime log is written to %ProgramData%\miPDFconvert\miPDFconvert.log.

Licensing

miPDFconvert is licensed under the GNU Affero General Public License v3 — see LICENSE. Because it combines AGPL/GPL components, the complete corresponding source code must be made available to recipients (including users interacting with it over a network, per AGPL §13).

Third-party components and their licenses are documented in THIRD-PARTY-NOTICES.md:

  • mfilemon (print port monitor) — GPL-2.0-or-later
  • clawPDF / PDFCreator (setup helper & architecture) — AGPL-3.0
  • Ghostscript (PDF engine, bundled unmodified, invoked as an external process) — AGPL-3.0
  • Microsoft Visual C++ runtime (app-local, for Ghostscript) — Microsoft redistributable
  • log4net — Apache-2.0

Note on Ghostscript: The installer bundles the unmodified Ghostscript binaries under the AGPL v3. The complete corresponding source code of the bundled version is attached to every GitHub release (ghostscript-<version>.tar.xz) and is also available from Artifex.

This project is not affiliated with or endorsed by clawSoft, pdfforge, or Artifex Software.


Author

Wolfgang Mitterbucher — Software Engineering & Digital Identity, Leonding (Austria)

🌐 www.mitterbucher.com · 💼 LinkedIn · ✉️ office@mitterbucher.com

More open-source projects: miPDFconvert · miPDFvalidator · miEUDIverifier

About

Virtual PDF printer for Windows (AGPL) - print to PDF and hand it to a configurable target application. Based on clawPDF/mfilemon, uses Ghostscript.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages