C# 使用BarTender条码标签打印处理的例子
就是和那个GettingStartedwithActiveXAutomationUsingCsharp的白皮书里面说的一样
先引用一个BarTender的 Com. 然后就是
BarTender.ApplicationbtApp; BarTender.FormatbtFormat;
private void Form1_Load(object sender, EventArgs e) {
btApp = new BarTender.Application(); }
private void Form1_FormClosed(object sender, FormClosedEventArgs e) {
btApp.Quit(BarTender.BtSaveOptions.btDoNotSaveChanges); }
private void button2_Click(object sender, EventArgs e) {
btFormat = btApp.Formats.Open(@\ // 同样标签的份数
// 也就是一个标签,打印多少份 // 系统默认是 1
// 当1个标签,需要打印多份的时候,修改这个参数 // 例如:需要打印某种无序号物品的标签 // 需要打印 20个物品的标签。
// 这20个标签的号码,都是一样的。 btFormat.PrintSetup.IdenticalCopiesOfLabel = 1;
// 序列标签数
// 当这个数字大于1的时候,会额外的打其他的标签。 // 例如下面的 ZB1000 12345678 // 当序列标签数 = 4 的时候。(好像系统默认是 4) // 会打印出
// ZB1000 12345678 // ZB1000 12345679 // ZB1000 12345680 // ZB1000 12345681 // 4张标签。
btFormat.PrintSetup.NumberSerializedLabels = 1;
btFormat.SetNamedSubStringValue(\测试 V1.0\
btFormat.SetNamedSubStringValue(\btFormat.PrintOut(false, false);
btFormat.SetNamedSubStringValue(\测试 V2.0\
btFormat.SetNamedSubStringValue(\btFormat.PrintOut(false, false); }
主要是在C# 程序中,需要正确的填写btFormat.PrintSetup.IdenticalCopiesOfLabel与btFormat.PrintSetup.NumberSerializedLabels的数值。
相关推荐: