public sealed class ZplPrinterClient
Sends ZPL to a network printer (raw TCP, port 9100) or any stream (USB/serial adapters).
Constructors
| Signature | Description |
# ZplPrinterClient(string host, int port = 9100) | Sends ZPL to a network printer (raw TCP, port 9100) or any stream (USB/serial adapters). |
Properties
| Property | Type | Description |
Encoding { get; set; } | Encoding | Encoding for the ZPL bytes. Use UTF-8 together with ^CI28 (the label model does). |
Host { get; } | string | |
Port { get; } | int | |
Timeout { get; set; } | TimeSpan | |
Methods
| Method Signature | Returns | Description |
# AsConnection() | IPrinterConnection | This client as an IPrinterConnection. |
# GetStatusAsync(CancellationToken ct = default) | Task<ZplPrinterStatus> | Queries ~HS and parses the response. |
# SendAsync(string zpl, CancellationToken ct = default) | Task | |
# SendAsync(Label label, int dpi = 203, int copies = 1, CancellationToken ct = default) | Task | |
static # SendAsync(Stream stream, string zpl, Encoding? encoding = default, CancellationToken ct = default) | Task | Writes ZPL to an arbitrary stream (file, serial port, USB device handle). |
# SendBytesAsync(byte[] data, CancellationToken ct = default) | Task | Sends raw bytes over one TCP connection. |