Skip to content

PDF printer

Many programs, such as an ERP or inventory system, can only print documents. RUNOS, however, works with files in a folder. The bridge is a PDF printer: it appears in every program as a normal printer but writes every printout, without any prompt, as a PDF into a folder. A File trigger watches that folder.

RUNOS creates this printer. The PDFs are saved by the RUNOS service, a Windows service that starts with Windows: printouts arrive even when RUNOS is closed. No additional program is needed.

There is one printer and one service for all Windows users of the PC, but every user has their own folder: a printout goes into the folder of the user who printed it. On a terminal server, everyone prints on the same printer RUNOS, and each user’s workflows only get that user’s printouts.

ERP: print to "RUNOS" ──▶ Documents\RUNOS\Pools\RUNOS\2026-10-16 14-05-09 1.pdf ──▶ File trigger ──▶ workflow
  1. Open Printer in the activity bar and click Add printer.
  2. Fill in the fields in the window (name and folder are filled in already):
Field Meaning
Printer name The printer’s name in Windows and in every program, e.g. RUNOS or RUNOS Invoices. Not allowed: \ / , ! : * ? " < > |.
Applies to Which folder you edit: Current user (default) is your own folder, All users the folder for every Windows user of the PC who has not chosen their own (administrator rights). See Several Windows users.
Folder (Pool) Your folder: your printouts are saved here. Default Documents\RUNOS\Pools\<printer name>; every Windows user of the PC has their own and can change it without administrator rights. The folder must be on this PC: RUNOS rejects network shares (\\server\share) and mapped network drives (e.g. Z:\). Enter exactly this folder as the File trigger’s Pool (for the default: %userdocuments%\RUNOS\Pools\<printer name>). RUNOS creates it when saving if it does not exist yet.
File name Pattern for each file’s name, default %Y-%m-%d %H-%n-%s %i.pdf. It must contain %i and end with .pdf.
Paper size A4 (default) or US Letter. Programs that do not choose a paper themselves, such as Windows Notepad, print on it. A program with its own paper size, e.g. Word via Page Setup or an ERP with a fixed form, keeps its own. If a letterhead (PDFEditor operation Overlay) does not fit the page exactly, the paper size is usually the cause.
  1. Click Add printer and confirm the Windows prompt for administrator rights (only when creating a printer, when changing its file name, paper size or the folder for all users, or when the RUNOS service is missing, outdated or not running).

If an entry is invalid, the window names the problem and stays open with what you typed. The printer then appears as a card on the Printer page (with folder, file name and paper size) and can be selected in every program. The badge on the card shows where your folder comes from: Your folder, Folder for all users or Default folder.

Placeholder Meaning
%Y / %y Year, four / two digits
%m Month
%d Day
%H Hour (0–23)
%n Minute
%s Second
%i Counter: the lowest number from 1 for which no file exists yet

%i is required: an existing file is never overwritten, and the counter gives every printout a free name. A subfolder in the pattern is possible, e.g. %Y\%m\Invoice %i.pdf; the File trigger, however, only sees files directly in the pool.

  • Change: click the printer’s card or its pencil (Edit), change the folder, file name or paper size in the window, Save. It applies from the next printout. With Current user the folder only changes for you; the other users keep theirs. If you empty the Folder field there, the folder for all users (or the default) applies to you again. A printer from an older RUNOS version shows A4 and gets A4 the next time it is saved, unless you choose another size first. The printer name cannot be changed: add a printer with the new name and delete the old one.
  • Another printer: Add printer suggests a free name (RUNOS1, RUNOS2, …).
  • Open folder: the folder icon on the card opens your folder of the printer in Explorer (and creates it if it does not exist yet).
  • Delete: the red bin on the card removes the printer from Windows after a confirmation, for all users of the PC. Jobs of this printer that have not been printed yet are discarded; PDFs in the folder stay.

The easiest way is the Printer trigger: choose the printer in it. RUNOS then takes the printer’s folder for the signed-in user itself, with the filter *.pdf, and follows the folder when you change it here:

"Trigger": {
"Type": "Printer",
"Name": "InvoicePrint",
"Parameters": { "Printer": "RUNOS" }
}

A File trigger works as well: its Pool is the printer’s folder, the Filter is *.pdf:

"Trigger": {
"Type": "File",
"Name": "InvoicePrint",
"Parameters": {
"Pool": "%userdocuments%\\RUNOS\\Pools\\RUNOS",
"Filter": "*.pdf",
"CronExpression": "0/10 * * * * ?"
}
}

As soon as a PDF arrives in the folder, the running workflow whose Pool is exactly this folder checks the folder right away, without waiting for the next check by CronExpression. If several printouts arrive in quick succession, one check takes them all. The regular check stays and picks up everything else, e.g. files copied into the folder by hand. Immediate checks do not count towards RepeatCount.

The File trigger waits until the file is completely written and then moves it into its spooler. The folder stays empty, and the printer can keep writing into it at any time.

With %userdocuments% the same workflow works for every user, each with their own folder. The templates for the PDF printer (New in the workflow list) use the printer RUNOS this way.

4. Select the printer in the program and test

Section titled “4. Select the printer in the program and test”
  1. In the ERP (or whichever program prints), select the printer, for example for the invoice form.
  2. Open the workflow in RUNOS and click Listen.
  3. Print a document. After a few seconds the log shows TriggerFired with the file name and, if present, the script blocks found.

How to turn this into a validated XRechnung is shown in the XRechnung example.

The service finds out for every printout which Windows user printed it (from the job in the Windows queue) and saves the PDF in that user’s folder:

  1. the folder the user chose under Printer with Applies to: Current user,
  2. otherwise the folder for All users, if it is not in another user’s profile (for a printer set up with an older RUNOS version, that is the folder saved back then),
  3. otherwise Documents\RUNOS\Pools\<printer name> of that user.

So the printer is created once, also for 30 users on a terminal server. An administrator sets the common folder like this:

  1. Open Printer and click the printer (or Add printer).
  2. Set Applies to to All users.
  3. Enter the folder under Folder, e.g. D:\Scans\%USERNAME%. %USERNAME% is the Windows user name of whoever prints: Anna prints to D:\Scans\anna, Ben to D:\Scans\ben. It is the only placeholder in this field. Without %USERNAME%, all users’ printouts land in the same folder. Empty = each user’s Documents\RUNOS\Pools\<printer name>.
  4. Click Save and confirm the prompt for administrator rights. It applies from the next printout.

Users who chose their own folder with Current user keep it; to go back to the common folder, they empty the Folder field there and save. Whoever saves All users follows the common folder themselves too. Every user must be allowed to write in the common folder; the service creates the subfolder with their name on the first printout. In the File trigger, enter the same folder as Pool; RUNOS replaces %USERNAME% there with the signed-in user as well: "Pool": "D:\\Scans\\%USERNAME%".

If the user is signed in (also a disconnected session), the service writes as this user, with their rights: a PDF never lands where the user may not write themselves, and the file belongs to them. A printout from an account without a Windows session, such as an ERP running as a service, goes to the folder for all users (with that account’s name for %USERNAME%), otherwise to that account’s Documents\RUNOS\Pools\<printer name>; a folder chosen with Current user is not used then. The service recognises who printed from the job the Windows queue shows as “Printing” at that moment; it waits up to 10 seconds for it. It never guesses: if no such job is visible, or the jobs belong to different users, the printout counts as unassigned (see below), unless there is a fixed folder for all users without %USERNAME%.

If the service cannot assign a printout to a user (no user can be determined, or an account without a session and without a profile on this PC) or cannot write the user’s folder and there is no fixed folder for all users, the printout is not lost: the service saves it in C:\Program Files\RUNOS\Service\Unassigned\<printer name>. Only administrators (and the RUNOS service) can open this folder, not normal users, because it may contain confidential documents. The service log (C:\Program Files\RUNOS\Service\Logs) then has a warning with the file name, folder and reason. An administrator checks the PDF and moves it to the right user’s folder, where that user’s workflow processes it.

While the RUNOS service is not running, the RUNOS of the signed-in user receives the printouts itself and saves them in that user’s folder. It refuses a printout from another user (error in the log) so it does not land in the wrong folder; that printout is lost. On a terminal server, make sure the service runs (Fix now in the notice on the Printer page).

The printer only uses parts of Windows: the Microsoft Print to PDF driver, which creates the PDF (text stays text), and a local port (Local Port) named \\.\pipe\RUNOS_PDF_<printer name>. Through this port Windows hands the finished PDF to the RUNOS service instead of asking for a file name. The service first writes it into the hidden subfolder .runos-incoming of the printing user’s folder and then moves it into the folder under the name from the file name pattern, so the File trigger only sees complete files. If the service cannot write to the folder, it does not accept the printout: the job stays in the Windows queue and Windows retries it.

The RUNOS service runs as a Windows service under the system account, starts automatically with Windows and is restarted after a crash. It is installed in C:\Program Files\RUNOS\Service and writes its log to C:\Program Files\RUNOS\Service\Logs (one file per day, kept 14 days). Deleting the last printer does not remove the service.

Each printer’s file name and paper size are stored under HKEY_LOCAL_MACHINE\SOFTWARE\RUNOS\PdfPrinters\<printer name> (and, for printers from older versions, the folder they had). Each user’s own folder is stored under HKEY_CURRENT_USER\Software\RUNOS\PdfPrinters\<printer name>. On every save RUNOS sets the paper size as the printer’s default in Windows, for all users and for the user who saves. Nothing is copied to C:\Windows\System32, and the print spooler is not restarted.

If an administrator switched off “Microsoft Print to PDF” under Windows Features, RUNOS switches it back on when saving.

Every printout appears in the service’s log as PDF printer "…": saved … for <user>. On start, the service writes the Windows version to its log, and every 30 seconds it checks the queue of each RUNOS printer: a job that hangs with an error, or is still printing after a minute, appears as PDF printer "…": job … is stuck in the Windows queue, with the time Windows last opened the port. If RUNOS is open and a workflow starts right away, the RUNOS log shows PDF printer "…": … arrived; workflow "…" checks its folder now.

Problem Cause and solution
“Administrator rights were not granted” The Windows prompt was declined. Save again and confirm with Yes, with an administrator account if needed.
“A printer named … already exists and is not a RUNOS printer” Another printer has this name. Choose a different name.
“… could not be switched on” The Windows driver is missing. Turn on Microsoft Print to PDF under Windows Features (optionalfeatures.exe) and save again.
“The folder must be on this PC” / “… is on a network drive” The folder is on a network share or network drive. Choose a folder on this PC.
“… the RUNOS service could not be installed or started” The printer was created, but the service was not. Until it runs, RUNOS receives the printouts only while it is open. Save again; if security software blocks C:\Program Files\RUNOS\Service\RUNOS.Service.exe, allow it.
The job shows “Error” in the Windows print queue The RUNOS service is not running, or it cannot write to the folder. Check “RUNOS Service” under Services and search the service’s log for “PDF printer”. If a job hangs for more than a minute, the log shows “… is stuck in the Windows queue” with its status and the Windows version. If it continues with “Windows has not connected to the port”, Windows cannot open the port: update RUNOS to the current version and save the printer once (on Windows 11 24H2 and Windows Server 2025, prints always hung with older versions); otherwise check whether security software blocks the service. If it says “Windows last connected …”, the folder is the problem; the lines before it give the reason. The job arrives by itself as soon as this is fixed.
“… in the folder for unassigned prints …” The service could not assign the printout to a user or could not write the user’s folder; the reason follows “because”. The PDF is in C:\Program Files\RUNOS\Service\Unassigned\<printer name> (administrators only). Check it and move it to the right folder, see Unassigned printouts. If it keeps happening, report it with the service’s log.
The PDF arrives in another user’s folder, or in Documents\RUNOS\Pools\… instead of your folder The printout came from another Windows account (e.g. an ERP running as its own user or as a service). The service log names the user after saved … for. Choose the folder while signed in as that account, or use that account’s folder as the Pool.
No file arrives in the folder Search the service’s log (C:\Program Files\RUNOS\Service\Logs) for “PDF printer”. If the PDF could not be saved under its name, it is in the folder’s hidden subfolder .runos-incoming.
“another program on this PC … receives its prints” Another program holds the printer’s port, usually RUNOS under another Windows user while the service is not running. Install the service (Fix now in the notice on the Printer page); then only the service receives the printouts.
The file arrives but the workflow does not start Is the workflow running (list shows Stop)? With a Printer trigger: is the right printer chosen? With a File trigger: is the Pool exactly the printer’s folder, does the Filter match? If several workflows share the folder, the file must name the workflow in its script blocks (Shared pool).
The PDF has the wrong paper size (e.g. US Letter instead of A4) Edit the printer, choose the size under Paper size and Save. If the program chooses its paper itself (Word, ERP), set the size there. If a user picked their own paper in Windows’ Printing preferences, that one applies for them; change it there.
Script blocks are not found The PDF contains no text: the form prints the lines as graphics. Use a real font in the form.