使用Barcode Professional for Windows Forms条码控件,开发人员可以快速地打印出指定大小的条码,具体参考下面简单的代码:
private void printDocumentObject_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
//Create a Barcode Professional object
BarcodeProfessional bcp = new BarcodeProfessional();
//Barcode settings
bcp.Symbology = Symbology.Code39;
bcp.Code = "123456789";
//...
//Print the barcode to fit an area of size 2x1in using DrawOnCanvas method
bcp.DrawOnCanvas(e.Graphics, New PointF(0,0), New SizeF(2f,1f));
}