Prints through Zebra Nucleus (Zebra Cloud Print API) to a printer anywhere – the printer only needs its WebLink connection to the Nucleus tenant, no network route from here. Drop-in for every IPrinterConnection use: await using var printer = new NucleusPrinterConnection("XXZJJ174600974"); // token from ZEBRA_NUCLEUS_TOKEN await label.For<Shipment>().PrintAsync(printer, shipments);NucleusPrinterConnection.SendAsync submits one print job per call and throws when the printer refuses it (missing licence, unknown serial number …). NucleusPrinterConnection.LastJobId and NucleusPrinterConnection.LastAlerts describe the last job; with NucleusPrinterConnection.WaitForCompletion each send also waits until the job completed. NucleusPrinterConnection.QueryAsync returns null: the API has no live status query (status comes as the printer's alerts with each print).
Constructors
| Signature | Description |
# NucleusPrinterConnection(string serialNumber, NucleusCloudPrintOptions? options = default) | Connection to one printer (serial number in the Nucleus tenant); token from the options or the environment. |
# NucleusPrinterConnection(string serialNumber, string token) | Connection to one printer with an explicit API token. |
# NucleusPrinterConnection(NucleusCloudPrintClient client, string serialNumber) | Connection over a shared client (several printers, one token). |
Properties
Methods
| Method Signature | Returns | Description |
# CancelLastAsync(CancellationToken ct = default) | Task<bool> | Cancels the last job if it is still pending (see NucleusCloudPrintClient.CancelAsync). |
# DisposeAsync() | ValueTask | |
# QueryAsync(string command, TimeSpan timeout, CancellationToken ct = default) | Task<string> | Always null: the Cloud Print API has no command/status channel. See NucleusPrinterConnection.LastAlerts. |
# SendAsync(byte[] data, CancellationToken ct = default) | Task | |
# ToString() | string | |
Events
| Event | Handler Type | Description |
JobAccepted | Action<NucleusPrintResult> | Raised for every accepted job (job id and alerts), e.g. to log it next to the own job. |