Hi Paddy !
Could you please repeat your message of July 7 Th?
Sure !
Note that the code snips ar intended for use with a label printer. But the article should cover what
you're looking for (I think).
You need to send the data raw to the printer, otherwise Windows will eat the control codes alive.
First of all read this article:
HOW TO: Send Raw Data to a Printer by Using Visual C# .NET
http://support.microsoft.com/?kbid=322091
Copy the article code into a classfile.
Then you'll have to do something like the code below. (sorry about the formating )
(Note: The SendDocTo Printer is my addon to the article, where I have added a few methods so I could
pass a memorystream, and stream from a embedded resource file etc.
I have a lot of experience with Eltron Orion/2443 and Zebra 2443/2444 and DataMax label printers,
but almost everything I've done is done in Delphi. I've jsut started porting this stuff to C#
myself. Anyway, if you're stucked - contact me and I can see if I can help you - no garantee though
<snip>
private void btnPrint2_Click(object sender, System.EventArgs e)
{
PrintDialog pd = new PrintDialog();
pd.PrinterSettings = new PrinterSettings();
if (DialogResult.OK == pd.ShowDialog(this))
{
MemoryStream memStrm = new MemoryStream();
StreamWriter sw = new StreamWriter(memStrm);
sw.WriteLine("\x02L");
sw.WriteLine("H07");
sw.WriteLine("D11");
sw.WriteLine("19110080200002510K Ny linje");
sw.WriteLine("19110080100002510K OHM 1/4 WATT");
sw.Flush();
sw.WriteLine("1a6210000000050590PCS");
sw.WriteLine("E");
sw.WriteLine("");
sw.Flush();
memStrm.Position = 0;
LabelPrint.SendDocToPrinter(pd.PrinterSettings.PrinterName,memStrm);
sw.Close();
</snip>
<snip2>
private void btn3_Click(object sender, System.EventArgs e)
{
PrintDialog pd = new PrintDialog();
pd.PrinterSettings = new PrinterSettings();
if (DialogResult.OK == pd.ShowDialog(this))
{
string p = pd.PrinterSettings.PrinterName;
LabelPrint.SendStringToPrinter(p,"\x02L"); // ^BL
LabelPrint.SendStringToPrinter(p,"H07");
LabelPrint.SendStringToPrinter(p,"D11");
LabelPrint.SendStringToPrinter(p,"19110080100002510K OHM 1/4 WATT");
LabelPrint.SendStringToPrinter(p,"1a6210000000050590PCS");
LabelPrint.SendStringToPrinter(p,"E");
LabelPrint.SendStringToPrinter(p,"");
}
}
</snip2>
Best wishes
Kai Bohli
(e-mail address removed)
Norway