Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

C# and printing barcodes with the zebra t402

C# and printing barcodes with the zebra t402

C# and printing barcodes with the zebra t402

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,

RE: C# and printing barcodes with the zebra t402

try a different set of x-y coords

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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close