It is really difficult to find something on internet to print zebra code from asp.net form
Code is simple and strait forward.
It allows you to print barcode and also access zebra printer from asp.net.
1. Install font which is free on .net “3 of 9 Barcode”
2. Create an Asp.net project
3. Add this code
public void Submit_Click(object sender, EventArgs e)
PrintDocument pd = new PrintDocument();
pd.PrintPage += new PrintPageEventHandler(pd_PrintPage);
// Set the printer name.
//pd.PrinterSettings.PrinterName = "file://ns5/hpoffice
//pd.PrinterSettings.PrinterName = "Zebra New GK420t"
catch (Exception ex)
Response.Write("Error: " + ex.ToString());
void pd_PrintPage(object sender, PrintPageEventArgs ev)
Font printFont = new Font("3 of 9 Barcode", 17);
Font printFont1 = new Font("Times New Roman", 9, FontStyle.Bold);
SolidBrush br = new SolidBrush(Color.Black);
ev.Graphics.DrawString("*texttodisplay*", printFont, br, 10, 65);
ev.Graphics.DrawString("*texttodisplay*", printFont1, br, 10, 85);