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进程
}
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进程
}
相关文章推荐
- Office Word 是如何根据字体的 OS/2 表等信息计算「单倍行距」的
- c#虚拟打印机
- modbus 入门篇
- C#汉字转拼音(npinyin)将中文转换成拼音全文或首字母
- 6 让我们的C#程序开始做点数学运算
- C# 读取大文件 (可以读取3GB大小的txt文件)
- c#判断字符串是否为汉字
- 《C#高级编程》读书笔记(一)
- C#在DataGridView当鼠标移到某行时,该行改变颜色
- leetcode 283 Move Zeroes --个人的新思路
- c#一个FTP操作封装类FTPHelper
- C# 文件转字节数组 byte[]
- .NET C# Tostring() format 格式化字符串大全
- 用C#操作office组件库实现word文档的创建及文字 表格 图片的插入
- C# 基础·算法篇
- C#开发和使用中的33个技巧
- c# DataGridViewComboBoxColumn
- c#.net 生成清晰缩略图
- c#中list容器学习
- C# Repeater 嵌套