Wednesday, February 24, 2010

Print Zebra barcode label thru' ASP .NET

Recently, one of the projects I am maintaining required me to enhance the existing feature, which is printing the Zebra barcode label through ASP .NET. The old staff who developed it left the company long time ago, and there's no other colleagues know how it was developed and worked.

Printing it as WinForm application is not uncommon with the SerialPort Class, as there's a lot of resources out there, but not so true for ASP .NET.

So I needed to google around and posted question to the forums. With some lucks and googling skills, i managed to let it works and add enhancement on that. But i found not full steps on web, so just to post this to help someone who might need it in the future.

1.a) Set the "Generic/Text Only" as default printer driver. Yes, you see it correctly, it's not zebra printer driver that match your zebra printer, since it's printed through web.


1.b.i) If you do not have it, you can go to any existing printer property page (right-click on any other printer driver) and add this driver.


1.b.ii) Browse to driver list start with "G", then you will find it. Finish this installation process.


2) Once you have the driver, setup the ASP designer with Zebra programming language (ZPL) like this (The buttons are for user to trigger the ZPL to send).

3) By calling the undocumented print() function (not window.print(), and I think it works on IE only) in javascript, you can print the zebra bar-code label through ASP.NET.

4) Keep the web form as clean code as possible, you will send it as ZPL and ZPL only to printer.

5) Print it! You should get it ;)

23 comments:

Craig said...

Very nice solution! I have a question, however. Will this work in a scenario where the client pc is not directly connected to the label printer (i.e. the label printer is a network printer to the client of the app). Seems that specifying the Generic/Text print driver on the client would prohibit choosing the desired network resource? I'm hoping i'm wrong :)

gary said...

network resource? I do no think it works, unless that network printer is specified the Generic/Text print driver. :D

Unknown said...

Thank you very much for your post.
I'm trying to print a barcode label from a web page and i don't understand where you see the result of the print() instruction.

I have not installed any driver of Zebra. I only have my EPSON printer :)

I have selected de Generic/Text Only driver but when i press "Print" button and select the printer nothing happens.

Thanks for your help.
Regards.

gary said...

EPSON printer? Hmmm..., no idea.
this print() command is undocumented, I also could not find it thru' google, and it's in the part of the existing code that left from my previous colleague.

Olen said...

I'm trying to print to a LP 2844. If I change the driver to generic/text only, the printer does not respond to the print request. If I change the driver back to zebra, then it does not interpret the EPL. I have to use EPL on this printer and not ZPL.

Any help is appreciated.

Rahul Mehta said...

what is that zebra programming code and where u get it from

its urgent?

Rahul Mehta said...

what is that zebra programming code.

can u put more light on that

its little urgent

Craig Fordham Site Admin said...

Great idea of printing the Zebra barcode
Plastic Card Printer

Unknown said...

Can you send the code for the same?...If possible send it on

swapnil.k.fegade@gmail.com

mya said...

I'm trying to print to a Zebra 2824 with EPL.

With the zebra driver the printer prints the EPL text.

I selected the Generic/Text and when i print and select the printer no document goes to the printer.

Can you help me on this?

Thank you!

mya said...
This comment has been removed by the author.
Albion Hill said...

Hello,
This is a nice post. It is all about the zebra labels. It is having a very high demand. Thank you..
zebra labels

vasu0020 said...

Hi gary,

Thanks for your post. I have tried the same approach but the printer printing empty label or printing nothing.

can you please help me on this.

Anna Schafer said...

If you need a more complete shipping solution than what eBay and PayPal offer, some of our Certified Providers can help.Impresion de etiquetas en fibra de coco

Unknown said...

Hey everyone find here the best Barcode Supplies in Anaheim, CA. EBarcode is the experience group that supplies electronics appliances, printers, scanners and other accessories.

Unknown said...

nice blog!! visit here for barcodes supplies and scanners.

Unknown said...

HI,
wow, great writing. very informative & helpful.
also i knew many things from this site
( Best Printer in the World).
This site is also very trusted site.

can you tell me how to choose best printer? .
Also i want to mention that i read your post regularly.Your post is informative and helpful to us.
Thanks

David Stewart said...

Very informative blog. Thanks for sharing valuable information with us. For best Barcode Label Printer in the USA, you can contact Texas Barcode Systems.

shushant said...

Hey!! thank you for sharing information on how to print zebra barcode labels manufacturers

Azad Barcosofttech said...

With cards becoming deeply ingrained into people’s lives, it has become important for business to have a POS machine. Aligned with market dynamics, The Barcosoft Tech offers you light weighted, fully-featured POS Machine dubai that offers you seamless payment processing facility. https://www.barcosofttech.com/products/point-of-sale

Ava Luke said...

Zebra DS2208 BarCode Scanner in UAE, Zebra SR7U2100SGW Series BarCode Scanner in UAE, BarCode Scanner in UAE
https://gccgamers.com/zebra-series.html
Zebra DS2208 Scanner in UAE, Safe Shopping Multiple Payment Options Express Delivery GCC Gamers Moneyback Guarantee.
1633919068149-9

Bar Code India said...

Thanks for your post.
A barcode scanner can read the specific sequence of bars and spaces, which indicate numbers and other things. Similarly, a Zebra barcode printer is available to print the barcode labels.

doctor said...
This comment has been removed by the author.