Print Image using Custom Printer RRS feed

  • Question

  • User-2071802366 posted

    Hi all,

    i am trying to print from Web Applicaton to Label Printer. where i need to fetch the image from the folder and then print to Label Printer.

    i had tried some code below, in which when i press to print a empty paper comes out of the label printer. so please help me as do i miss something ?

    protected void Print_Click(object sender, EventArgs e)
                    PaperSize pS = new PaperSize("Custom Size", 23, 23);
                    label.DefaultPageSettings.PaperSize = pS;
                    label.PrinterSettings.PrinterName = "Brother QL-700";
                    label.PrinterSettings.DefaultPageSettings.PaperSize = pS;
                    label.PrintPage += new PrintPageEventHandler(label_PrintPage);
                catch (Exception ex)
       private void label_PrintPage(object sender, PrintPageEventArgs e)
                SolidBrush brush = new SolidBrush(Color.Black);
                Font header = new Font(FontFamily.GenericSansSerif, 12.0F, FontStyle.Bold);
                System.Drawing.Image i = System.Drawing.Image.FromFile("E://qrcode.png");
               e.Graphics.DrawImage(i, 100, 100, 22, 22);

    Tuesday, October 8, 2013 3:44 AM


All replies