zplCore.comzplCore.com

PrinterDiscovery

public static class PrinterDiscovery

Best-effort enumeration of USB-attached printers (no extra dependencies, no raw USB access).

Windows: spooler printers on USBnnn ports (printed through the spooler, datatype RAW). Linux: /dev/usb/lp* device files (usblp kernel driver) plus CUPS queues with usb:// devices. macOS: CUPS queues with usb:// devices (via lpstat -v).

Methods

Method SignatureReturnsDescription
static # FindUsbPrintersAsync(CancellationToken ct = default)Task<IReadOnlyList<DiscoveredPrinter>>
static # ParseLpstatDevices(string output)IReadOnlyList<(string, string)>Parses lpstat -v output ("device for QUEUE: URI").