-2

I am still new to c# and never before have dealt with Zebra printers. Now I need to print barcodes to Zebra printer (Toshiba B-FV4T). I have read here some similar questions but still can't figure out how to do it. I make query from database and get records where one field is barcode string (for example "5247700000000") to the list.

List<OrderLine> orderLines = db.OrderLines.Where(otr => 
    (o.OrderLineID == SelectedOrder.ID) && 
    (o.Good.Group6 == "1" || o.Good.Group6 == "X")).ToList();

Now I need to print out only barcodes.

Thought maybe this is useful but didn't figure out, how to use barcode field there.

Any help please!

abdul
  • 1,504
  • 1
  • 16
  • 22
  • A quick hint, barcode is just a font, so have a look at @AndriiHorda SDK link which will allow you to pass numbers to be printed – Maxoizs Jan 04 '17 at 10:41
  • Please read the specs of the printer, for specific printer language and host interfaces. Once done so, connect the printer to your computer, open a channel on the interface, and send some commands in the printer language over the wire. In your scenario: Read the [ZPL II-manual](https://www.zebra.com/content/dam/zebra/manuals/en-us/software/zplii-pm-vol1.pdf) for barcode commands, and connect via the com/usb/lan-port. Read up: http://stackoverflow.com/questions/2044676/net-code-to-send-zpl-to-zebra-printers –  Jan 04 '17 at 12:16

1 Answers1

1
  1. Connect your printer to a host.
  2. Install predefined barcode fonts.
  3. Use this example: https://www.codeproject.com/Tips/142616/Generating-and-Printing-Barcodes-on-Zebra-Printer

UPD: or use this lib in trial mode, which will never end, then buy it if its ok http://www.neodynamic.com/products/printing/thermal-label/sdk-vb-net-csharp/download/

Andrii Horda
  • 160
  • 1
  • 14
  • Yes, I have seen this example, but how to send field from list for printing? I understand that here `ev.Graphics.DrawString("*AAAAAAFFF*", printFont, br, 10, 65);` first parameter must be the field. – Rein Kannumäe Jan 04 '17 at 10:59
  • @ReinKannumäe I think all you have to do is to replace first parameter with your barcode value. `foreach(var order in orderLines ){ev.Graphics.DrawString(order.Code, printFont, br, 10, 65); }` Something like that – Andrii Horda Jan 04 '17 at 11:21