zplCore.comzplCore.com

CupsPrinterConnection

public sealed class CupsPrinterConnection : IPrinterConnection, IAsyncDisposable

Sends raw data to a CUPS queue on macOS/Linux via lp -d <queue> -o raw. Write-only.

Constructors

SignatureDescription
# CupsPrinterConnection(string queue, string lpPath = "lp")

Properties

PropertyTypeDescription
JobTitle { get; set; }string
LpPath { get; }string
Queue { get; }string

Methods

Method SignatureReturnsDescription
# BuildArguments()IReadOnlyList<string>The argument list passed to lp.
# DisposeAsync()ValueTask
static # IsValidQueueName(string queue)boolCUPS queue names may contain any printable character except space, tab, "/", "\", "#", quotes and control characters (lpadmin rules). A leading '-' is rejected so the name can't be taken as an lp option.
# QueryAsync(string command, TimeSpan timeout, CancellationToken ct = default)Task<string>Write-only transport: returns null without sending anything (a query must not end up as a print job).
# SendAsync(byte[] data, CancellationToken ct = default)Task