您的位置:首页 > 编程语言 > C#

c# BarTender打印

2016-06-20 18:11 405 查看
1.btw文件创建时设置“源”为打印机代码模板字段

        2.共享名称中设置 传递变量名称

  //打印

       BarTender.Application btApp;

        BarTender.Format btFormat;

        private void button1_Click(object sender, EventArgs e)

        {

            btFormat = btApp.Formats.Open(@"D:\testlabel\testlabel.btw", false,"");

            btFormat.PrintSetup.IdenticalCopiesOfLabel = 1;  //设置同序列打印的份数

            //btFormat.PrintSetup.NumberSerializedLabels = 1;  //设置需要打印的序列数

            btFormat.SetNamedSubStringValue("Label_data01",textBox1.Text.Trim()); //向bartender模板传递变量

            btFormat.PrintOut(false, false); //第二个false设置打印时是否跳出打印属性

            btFormat.Close(BarTender.BtSaveOptions.btSaveChanges); //退出时是否保存标签

        }

        private void Form1_Load(object sender, EventArgs e)

        {

            btApp = new BarTender.Application();

        }

        private void Form1_FormClosed(object sender, FormClosedEventArgs e)

        {

            btApp.Quit(BarTender.BtSaveOptions.btSaveChanges);//界面退出时同步退出bartender进程

        }
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: