How porrey/virtual-zpl-printer works
Virtual ZPL Printer is a desktop Ethernet-based virtual Zebra label printer for testing applications that generate ZPL. A client sends ZPL over TCP; the listener hands requests to a client handler, which uses request handlers to process them and can request rendered labels from Labelary and cache resulting images. The repository also includes printer configuration, templates, font management, host-status handling, and optional physical printing. The README documents capabilities beyond the sampled source; those branches are shown where useful, but their internal wiring is not asserted.
Main entry points: TcpListenerClientHandler.cs Client Handler · LabelService.cs Label Service · ImageCacheRepository.cs Image Cache · HostStatusRequestHandler.cs Host Status Handler
Components 19
TCP Request Handling
- TCP Listener
Src/Virtual Printer Solution/VirtualPrinter.HostedService.TcpSystem/Hosted Services/TcpListenerService.cs - Client Handler
Src/Virtual Printer Solution/VirtualPrinter.HostedService.TcpSystem/Models/TcpListenerClientHandler.cs - Handler Factory
Src/Virtual Printer Solution/VirtualPrinter.Handler.Abstractions/Factories/RequestHandlerFactory.cs - Template Handler
Src/Virtual Printer Solution/VirtualPrinter.Handler.Abstractions/Request Handlers/TemplateRequestHandler.cs - ZPL Handler
Src/Virtual Printer Solution/VirtualPrinter.Handler.Zpl/Request Handlers/ZplRequestHandler.cs - Host Status Handler
Src/Virtual Printer Solution/VirtualPrinter.Handler.HostStatus/Request Handlers/HostStatusRequestHandler.cs
Label Rendering
- Label Service
Src/Virtual Printer Solution/Labelary.Service/LabelService.cs - Font Service
Src/Virtual Printer Solution/VirtualPrinter.FontService/Models/FontService.cs - Image Cache
Src/Virtual Printer Solution/ImageCache.Repository/Repositories/ImageCacheRepository.cs
Printer State
- Printer Configuration
Src/Virtual Printer Solution/VirtualPrinter.Db.Ef/Models/PrinterConfiguration.cs - Configuration Repository
Src/Virtual Printer Solution/VirtualPrinter.Db.Ef/Repositories/PrinterConfigurationRepository.cs - App Settings
Src/Virtual Printer Solution/VirtualPrinter.ApplicationSettings/Repositories/Settings.cs
Desktop Capabilities
- Printer UI
Src/Virtual Printer Solution/VirtualPrinter/App.xaml.cs - Template Repository
Src/Virtual Printer Solution/VirtualPrinter.TemplateManager/Repositories/LabelTemplateRepository.cs - Font Manager
Src/Virtual Printer Solution/VirtualPrinter/ViewModels/Primary/FontManagerViewModel.cs - Physical Printer
Src/Virtual Printer Solution/VirtualPrinter.HostedService.PrintSystem/Models/PhysicalPrinter.cs
Other components
- ZPL Client
Src/Virtual Printer Solution/VirtualPrinter.TcpClient/Models/ZplClient.cs - Labelary API
- Physical Printer Device
Connections 20
- ZPL Client → TCP Listener: sends ZPL
- TCP Listener → Client Handler: dispatches clients
Src/Virtual Printer Solution/VirtualPrinter.HostedService.TcpSystem/Hosted Services/TcpListenerService.cs - Client Handler → Handler Factory: requests handlers
Src/Virtual Printer Solution/VirtualPrinter.HostedService.TcpSystem/Models/TcpListenerClientHandler.cs - Handler Factory → Template Handler: creates handlers
- Client Handler → Label Service: requests labels
Src/Virtual Printer Solution/VirtualPrinter.HostedService.TcpSystem/Models/TcpListenerClientHandler.cs - Client Handler → Image Cache: stores images
Src/Virtual Printer Solution/VirtualPrinter.HostedService.TcpSystem/Models/TcpListenerClientHandler.cs - Template Handler → Label Service: uses service
Src/Virtual Printer Solution/VirtualPrinter.Handler.Abstractions/Request Handlers/TemplateRequestHandler.cs - Label Service → Font Service: loads referenced fonts
Src/Virtual Printer Solution/Labelary.Service/LabelService.cs - Label Service → Labelary API: renders ZPL
Src/Virtual Printer Solution/Labelary.Service/LabelService.cs - Label Service → Image Cache: returns label data
- Host Status Handler → Label Service: checks service
Src/Virtual Printer Solution/VirtualPrinter.Handler.HostStatus/Request Handlers/HostStatusRequestHandler.cs - Host Status Handler → Image Cache: uses cache
Src/Virtual Printer Solution/VirtualPrinter.Handler.HostStatus/Request Handlers/HostStatusRequestHandler.cs - Configuration Repository → Printer Configuration: persists settings
Src/Virtual Printer Solution/VirtualPrinter.Db.Ef/Repositories/PrinterConfigurationRepository.cs - Client Handler → Printer Configuration: uses configuration
Src/Virtual Printer Solution/VirtualPrinter.HostedService.TcpSystem/Models/TcpListenerClientHandler.cs - Client Handler → App Settings: reads settings
Src/Virtual Printer Solution/VirtualPrinter.HostedService.TcpSystem/Models/TcpListenerClientHandler.cs - Template Repository → App Settings: reads locations
Src/Virtual Printer Solution/VirtualPrinter.TemplateManager/Repositories/LabelTemplateRepository.cs - Font Manager → Font Service: manages fonts
Src/Virtual Printer Solution/VirtualPrinter/ViewModels/Primary/FontManagerViewModel.cs - Physical Printer → Physical Printer Device: prints labels
- Printer UI → Template Repository: offers templates
- Printer UI → Font Manager: offers font management