使用Barcode Professional for Windows Forms打印指定大小的条码

作者:控件中国网   出处:控件中国网   2015-08-12 14:26:55   阅读:32

使用Barcode Professional for Windows Forms条码控件,开发人员可以快速地打印出指定大小的条码,具体参考下面简单的代码:

target_bars_area.gif

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));
}   

Copyright© 2006-2015 ComponentCN.com all rights reserved.重庆磐岩科技有限公司(控件中国网) 版权所有 渝ICP备12000264号 法律顾问:元炳律师事务所
客服软件
live chat