Murli Jadhav

Murli Jadhav

  • NA
  • 258
  • 16.2k

How do I print barcode appears on panel using C#

Jul 13 2017 5:05 AM
float x = e.MarginBounds.Left;
float y = e.MarginBounds.Top;
Bitmap bmp = new Bitmap(this.panel2.Width, this.panel2.Height);
this.panel2.DrawToBitmap(bmp, new Rectangle(0, 0, this.panel2.Width, this.panel2.Height));
e.Graphics.DrawImage((Image)bmp, 0, 0
 
 
 
System.Drawing.Printing.PrintDocument doc = new System.Drawing.Printing.PrintDocument();
doc.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(printDocument1_PrintPage);
PaperSize ps = new PaperSize("", panel2.Width, panel2.Height);
//print...
printDocument1.DefaultPageSettings.PaperSize = ps;
doc.PrinterSettings.Copies = 1;
doc.Print();
 
 
By this method it is possible to print barcode on THERMAL PRINTER??? Any Suggtions?? Or Source code?? 

Answers (3)