|
|
|
@@ -57,12 +57,12 @@ open class ZebraPrinterUtil { |
|
|
|
|
|
|
|
// 4. Send the ZPL command to the printer via a network socket |
|
|
|
val printData = zplCommand.toByteArray() |
|
|
|
repeat(printQty ?: 1) { index -> |
|
|
|
Socket(printerIp, printerPort).use { socket -> |
|
|
|
val os: OutputStream = socket.getOutputStream() |
|
|
|
os.write(printData) |
|
|
|
os.flush() |
|
|
|
} |
|
|
|
repeat(printQty ?: 1) { index -> |
|
|
|
os.write(printData) |
|
|
|
os.flush() |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (e: Exception) { |
|
|
|
|