I am working on an ASP.NET Core Web API application hosted on IIS that serves as the backend for kiosk devices. Each kiosk runs Windows and has a USB-connected thermal printer (no LAN support). The kiosk UI runs in Chrome.
Initially, we shared the printer over the network and accessed it from the backend server, but this approach is unreliable due to frequent connection issues. To solve this, I started developing a minimal API that runs locally on each kiosk (as a Windows Service), so it can communicate directly with the USB printer.
The issue is printing. I previously used System.Drawing.Common and System.Drawing.Printing to generate and print receipts (including images, formatted text, tables, and Georgian characters). However, System.Drawing.Common is not supported in Windows Services due to its dependency on GDI+ and UI components. I also tried SkiaSharp, but ran into similar limitations or complexity for printing.
The printer is an older model: NIPPON PRIMEX NP-3511.
My requirements:
Print receipts automatically (no user interaction)
Include images (logo), formatted text, and non-Latin characters (Georgian)
Avoid network printer sharing
My questions:
What is the recommended approach to communicate with a USB thermal printer from a local .NET service or API?
Should I continue with a Windows Service, or is there a better architecture for this scenario?
What libraries or techniques can replace System.Drawing.Common for generating and printing receipts in this environment?
Any guidance or examples would be appreciated.