Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

C# and printing barcodes with the zebra t402

Status
Not open for further replies.

RyanBeaver

Programmer
May 21, 2003
1
0
0
US
Hello All,

I am currently doing development in c#, with a zebra t402. We have had the t402 for awhile, we previously programmed for it in vb6. Well, Im simply trying to get a little test to work correctly without much luck. In vb6, you could print a line of text to the printer with this code:
Printer.FontName = "Courier New"
Printer.FontBold = True
Printer.FontSize = 14
Printer.CurrentY = 1100 + Y + iPrintAdjY
Printer.CurrentX = 2500 + x + iPrintAdjX
Printer.Print "Assignment"

With the text Assignment being written to the label. I thought it would be a good test to try the same thing in c#, and through a little investigation, I found the equivelent statement by writing this:

e.Graphics.DrawString("Assignment", printFont, Brushes.Black, 1100, 2500);

Now when I send this to the printer, the status light blinks for a few seconds, and then it prints a blank label. Im not sure if Im not positioning the label correctly, Im not calling the correct method, or the printer is erroring out on my call. I thought this would be fairly simple opposed to passing in the zpl code for the barcode. I guess Im just a bit confused, I installed the print driver correctly along with testing the printer to see if it works correctly,. (by running the old vb6 application). Any suggestions or even directions on where to find some related materials would be greatly appreciated.

Thanks so much,
Ryan
 
try a different set of x-y coords

100,100
such as this.

e.Graphics.DrawString("Assignment", printFont, Brushes.Black, 100, 100);

e.Graphics.DrawString("Assignment", printFont, Brushes.Black, 500, 500);

or something to see if that makes a difference

DougP, MCP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top