lukevp / ESC-POS-.NET

Efficient, Easy to Use Thermal Printing & POS (Windows/Linux/OSX, WiFi/BT/USB/Ethernet)
MIT License
503 stars 166 forks source link

version 3.0 SerialPrinter issue #194

Open koo9 opened 1 year ago

koo9 commented 1 year ago

I have code that works in version 1.6 as the following: ` public EscPosPrinterCommander PrintToSerial(string comPort = "COM8", int baudRate = 115200) { using (var printer = new SerialPrinter(comPort ?? "COM8", baudRate)) { var data = _bytes.ToArray(); printer.Write(data); }

        return this;
    }`

but not working in 3.0, the reaason I suspect is the printer .Open method is 3.0, the printer connection is not yet open, if I put a breakpoint on the printer.write(), the it print, that may give it time to aquire a connect to the COM port. not sure if anyone else encounter the same.