I am trying to print barcode in zebra ZDesigner GK420t printer,but the printer is showing this page cannot be printed ,can an...

D Dhanam jayan 3 years 7 months ago
9 1 0

using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
 
namespace ServerPrintExample
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Button1_Click(object sender, EventArgs e)
        {
            System.Drawing.Printing.PrintDocument printdoc = new System.Drawing.Printing.PrintDocument();
            printdoc.PrinterSettings.PrinterName = "CutePDF Writer";
            printdoc.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(printdoc_PrintPage);
            printdoc.Print();
        }
        void printdoc_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
        {
            e.Graphics.DrawString(this.TextBox1.Text, new System.Drawing.Font("Arial", 16.0f), System.Drawing.Brushes.Black, new System.Drawing.PointF(10.0f, 10.0f));
            e.Graphics.DrawString(this.TextBox2.Text, new System.Drawing.Font("Free 3 of 9", 24.0F), System.Drawing.Brushes.Black, new System.Drawing.PointF(10.0f, 50.0f));
        }
    }
}

Please Register or Login to post a reply

1 Replies

K Kandarp Bhatt

Sir,
Can you able to take test print from printer it self.

CONTACT
Can’t find what you’re looking for?