I'm making an application that produce barcode labels. I'm using Sato LM408e thermal printer. In order to print I'm using sbpl command. I got no error, but the printer doesn't print anything. Is there anyone who has experience printing with sato barcode printer? lm 408e to be more specific
My Code:
PrintDialog printDia = new PrintDialog();
printDia.PrinterSettings = new PrinterSettings();
DialogResult result = printDia.ShowDialog();
StringBuilder sb = new StringBuilder();
sb.AppendLine("<STX><ESC>A");
sb.AppendLine("<ESC>H0001<ESC>V0001<ESC>XM45676567");
sb.AppendLine("<ESC>Q1");
sb.AppendLine("<ESC>Z<ETX>")
String output = sb.ToString().Replace("<ESC>", ((char)27).ToString());
output.Replace("<STX>",((char)2).ToString());
output.Replace("<ETX>", ((char)3).ToString());
if (result == DialogResult.OK)
{
RawPrinterHelper.SendStringToPrinter(printDia.PrinterSettings.PrinterName, output);
}
My string output:
String.Replace returns a new instance, it does not modify the original string.
((char)3).ToString() is "3", you need "\x3".
So, try this: