Skip to content

SendBinaryAsync

Description

Sends binary data to the printer without any conversion.
By sending printer commands as raw binary data, functions that are not supported by the library can also be used.
However, commands that require a response from the printer are not supported by this method.

Syntax

public Task SendBinaryAsync(byte[] data)

Warning

This method returns a Task. To ensure that the operation completes and any potential exceptions are properly captured, always call it with await. Omitting await may result in the operation being terminated midway or errors may go undetected.

Parameter

data

Specify the binary data as a byte array.
The maximum data size that can be sent at one time is 3 MB (3,145,728 bytes).

Sample

byte[] data = new byte[] { 0x0C };

try
{
    await printerManager.SendBinaryAsync(data);
}
catch (e: SIISLP800PrinterException)
{
    System.Diagnostics.Debug.WriteLine($"[MyApp] {e.HResult}");
}