Click here to Skip to main content
15,440,771 members
Articles / General Programming / Printing
Posted 11 Oct 2013


3 bookmarked

zebra barcode printing using

Rate me:
Please Sign up or sign in to vote.
0.00/5 (No votes)
11 Oct 2013CPOL1 min read
zebra barcode printing using asp.netIt is really difficult to find something on internet to print zebra code from form Yes what

This articles was originally at but has now been given a new home on CodeProject. Editing rights for this article has been set at Bronze or above, so please go in and edit and update this article to keep it fresh and relevant.

zebra barcode printing using

It is really difficult to find something on internet to print zebra code from form 
Yes what you will find is javascript to acheive the same. Also its easy to do from windows application.
Issue : when you use javascript , you have to save the image(barcode) on aspx page and then fire the javascript print command. It works well with lazer printer but has issue with Zebra printer as image  gets generated but there , we are not able to scan it. So Barcode generated is no use if you are using Zebra printer
Code is simple and strait forward.
It allows you to print barcode  and also access zebra printer from
1.       Install font which is free on .net “3 of 9 Barcode
2.       Create an 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);


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Written By
United States United States
The ASP.NET Wiki was started by Scott Hanselman in February of 2008. The idea is that folks spend a lot of time trolling the blogs, googlinglive-searching for answers to common "How To" questions. There's piles of fantastic community-created and MSFT-created content out there, but if it's not found by a search engine and the right combination of keywords, it's often lost.

The ASP.NET Wiki articles moved to CodeProject in October 2013 and will live on, loved, protected and updated by the community.
This is a Collaborative Group

757 members

Comments and Discussions

-- There are no messages in this forum --