Hi,
First of all. I hope I'm in the correct forum. If not let me know :-)
I have a job, where I have to print a printercode (Raw data) to a label printer (Citizen CLP621). I found this tutorial to do that:
http://support.microsoft.com/?kbid=322091.
When using the code I print to the label printer. No errors but it only prints a blank page, not any text at all. I tried to give it some code for the printer without success. Then I tried to print a text string (no code at all in it) also without any success.
Can anyone help me to figure out, why it doesn't print anything at all?
My code:
private void button2_Click(object sender, EventArgs e)
{
System.Drawing.Printing.PrintDocument pd = new System.Drawing.Printing.PrintDocument();
if (cbPrinter.SelectedIndex != -1)
{
string printerToUse = cbPrinter.Text;
if (!printerToUse.Equals(""))
pd.PrinterSettings.PrinterName = printerToUse;
pd.OriginAtMargins = true;
pd.DefaultPageSettings.Margins = new System.Drawing.Printing.Margins(20, 20, 0, 20);
if (checkBox1.Checked)
{
RawPrinterHelper.SendStringToPrinter(pd.PrinterSettings.PrinterName, "HereIsMyCodeForThePrinter");
}
else
{
RawPrinterHelper.SendStringToPrinter(pd.PrinterSettings.PrinterName, "LD11PGpGSGA21F1102100100010000199590101");
}
pd.Print();
this.labelsprinted = 0;
}
else
{
MessageBox.Show("Vælg en label printer");
}
}
I can see it go into the printer (prints a blank page) but it doesn't print anything on the paper (also not when I choose the string "HereIsMyCodeForThePrinter".
If I choose to make a bitmap image and print this to the printer it print the bitmap image out.
I really hope someone can help me. I'm stucked into this and don't know what to do.
Kind regards,
simsen :-)