0
Answer

Custom Printing

arun nagalingam

arun nagalingam

11y
1.2k
1

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) { try { 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); label.Print(); } catch (Exception ex) { Response.Write(ex); } } ******************************************************************************************************8 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); }