The "SerialPort" below is from OpenNETCF.IO.Ports.
Does this first pass/semi-edicated guess make sense for printing to a belt printer (Zebra QL220); that is, is it a decent starting point?
using (SerialPort serialPort = new SerialPort())
{
string someString = "Bla";
//serialPort.BaudRate = // I don't know what to put here yet, assuming this is needed
//serialPort.DataBits = // " "
//serialPort.Parity = // " "
//serialPort.StopBits = // " "
serialPort.PortName = "COM1"; // Is this what it wants?
serialPort.Open();
Thread.Sleep(2500); // I don't know why this is needed, or is it?
serialPort.Write(" ! U1 setvar \"device.languages\" \"line_print\"\r\n");
serialPort.Write(" ! U SETLP 5 1 46\r\nPAGE-WIDTH 480\r\nSETBOLD 2\r\nPRINT\r\n");
serialPort.Write(" ! U1 CENTER\r\n"+someString"\r\n! U1 SETBOLD 0\r\n");
serialPort.Write(" ! U1 CENTER\r\n");
serialPort.Write(" ! U1 SETLP 0 2 24");
serialPort.Close();
}
You might say, "Why don't you just try it and see?" but at present, at least, it's a long involved process to do that, because I can't run my app in my XP Mode VM on either deployment "Device" or Emulator (see How can I run my Windows CE project from within Visual Studio (2003)? if interested); what I need to do is copy the binary to the handheld to test any modified code; so, I'd rather be somewhat sure that it will work in some fashion before going through that rigamarole.