2019 SDK IPrinter.SendDataToPrinter What format is Data byte[]?

Label printing integration (NiceWatch middleware and ActiveX programming interface)

Moderator: NiceLabel Support Team

Post Reply
Valued Contributor
Posts: 23
Joined: Tue Sep 20, 2022 11:04 pm
Location: Indianapolis

2019 SDK IPrinter.SendDataToPrinter What format is Data byte[]?

Post by shawnWork » Mon Nov 28, 2022 6:00 pm

Question: What format/encoding should be the data byte[]?
- Base64, Ascii, etc.?

Information copied below from Nice Label SDK Help File.

Printer.SendDataToPrinter Method NiceLabel SDK.NET

Sends the data to printer by creating a new print job and sending it to the spooler.

Namespace: NiceLabel.SDK
Assembly: SDK.NET.Interface (in SDK.NET.Interface.dll) Version: (

C#VBC++F#Copyvoid SendDataToPrinter(
byte[] data
Sub SendDataToPrinter (
data As Byte()
void SendDataToPrinter(
array<unsigned char>^ data
abstract SendDataToPrinter :
data : byte[] -> unit

Type: System.Byte[]
The data for the print job.
See Also

IPrinter Interface
NiceLabel.SDK Namespace

User avatar
NiceLabel Support
NiceLabel Support
Posts: 325
Joined: Fri Jul 13, 2018 10:26 pm
Location: Milwaukee, Wisconsin

Re: 2019 SDK IPrinter.SendDataToPrinter What format is Data byte[]?

Post by Mytch » Wed Dec 07, 2022 12:29 am


Your "data" byte[] array should contain content that is encoded in a format which is understood by the destination printer (varies by PCL). This content contains the raw print commands which you will send to the hardware. There is no requirement from NiceLabel perspective, I would say UTF-8 is preferred over ASCII since I cannot see the benefit of the inverse.

The most common use-case is just reading an existing file to byte array then sending that directly to the printer, so it often just comes down to the format of existing content.

Simple example sending ASCII test to Zebra printer:
2022-12-06_16h30_26.png (53.42 KiB) Viewed 70 times
You can see we have sent 4 bytes of data to the printer, but in practice this should contain real ZPL commands for this printer.



Post Reply