Website: https://najm07.github.io/Printlink/
Peer-to-peer LAN printer sharing for small offices — no Windows printer sharing, no cloud, no accounts. Print from any PC to a printer attached to another PC on the LAN, with per-PC access grants that expire automatically.
alias @ name, e.g. CANON @ Lina's PC), so the lists stay
readable even with many printers — rename or remove entries any time from
“Manage remote printers…” (removing also tells the host to revoke your
grant).Your document -> preview dialog (printer, copies, pages, paper, color,
duplex, orientation, fit)
-> sender agent -> AES-GCM over HTTP :9100 -> host agent -> printer
No virtual printer and no port monitor: jobs are delivered directly between agents and handed to the physical printer by format:
| Format | Receiver handling |
|---|---|
| PyMuPDF page-range subset + SumatraPDF (or printto) | |
| Word (docx/doc) | Word COM automation (copies, page range) |
| Excel/PPTX | shell printto verb |
| PNG/JPEG/GIF/BMP/WEBP/TIFF/EMF | GDI+ via PowerShell |
| Text | spooler TEXT datatype |
Jobs travel encrypted (AES-GCM keyed by the pairing token) directly PC-to-PC.
agent/ Python tray agent (all PCs)
installer/ Inno Setup script (agent-only install)
docs/ architecture.md, protocol.md, security.md, debugging-notes.md
tests/ pytest suite
agent/pipe_reader.py is legacy code from the retired port monitor: it is
not used by the shipping product. It only activates if the agent is
started with LEGACY_PIPE_ENV=1 (see main.py); kept for anyone still
running an old port monitor.
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -r agent/requirements.txt
python agent/main.py
Requires Windows for real use (pywin32, spooler/COM/GDI+ printing). The share/identity logic and HTTP API are platform-independent and covered by tests that run on any OS.
python -m pytest tests/
Bundle the agent:
python -m PyInstaller --noconfirm PrintLinkAgent.spec
Produces dist\PrintLinkAgent.exe (onefile, windowed, ~52 MB; the spec
pins the excludes so the build stays fast and small).
Build the installer:
& "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" installer\printlink.iss
Produces installer\output\PrintLinkSetup-<version>.exe.
The installer registers the tray agent at login, opens firewall rules for
TCP 9100 (API) and UDP 5353 (mDNS) on the Private profile, and calls the
agent’s --install-verbs to add the right-click verb. On domain networks
the firewall rules are per-PC; adjust via GPO.
Since 0.2.3, agent data (printers, grants, tokens, identity) is shared
machine-wide in %PROGRAMDATA%\PrintLink so every user account on a PC sees
the same printers. This makes tokens readable by any local user — see
docs/security.md for the threat model and planned hardening.
/ping ID verification prevents stale-IP impersonation after DHCP churn.POST /revoke-grant lets a remote revoke its own access (token-verified,
so nobody can cut someone else’s grant); unsharing a printer revokes all
its grants.See docs/protocol.md for wire formats, docs/architecture.md for design,
and docs/security.md for the threat model.
PrintLink itself is MIT-licensed (see LICENSE). The preview thumbnails and PDF page-range rendering use PyMuPDF, which is AGPL-3.0 / commercial dual license. Anyone redistributing PrintLink commercially must swap in pypdfium2 or drop the preview (the receiver falls back to printing the whole file). Pillow (thumbnails) and PyInstaller (bundling) are similarly bundled under their respective licenses.