用barTender各种标签打印

**## BarTender 标签打印
工业型条码机

 lock (engine)
         {
            bool success = true;
            // Assign number of identical copies if it is not datasourced.
            if (format.PrintSetup.SupportsIdenticalCopies)
            {
               int copies = 1;
               success = Int32.TryParse(txtIdenticalCopies.Text, out copies) && (copies >= 1);
               if (!success)
                  MessageBox.Show(this, "Identical Copies must be an integer greater than or equal to 1.", appName);
               else
               {
                  format.PrintSetup.IdenticalCopiesOfLabel = copies;
               }
            }

            // Assign number of serialized copies if it is not datasourced.
            if (success && (format.PrintSetup.SupportsSerializedLabels))
            {
               int copies = 1;
               success = Int32.TryParse(txtSerializedCopies.Text, out copies) && (copies >= 1);
               if (!success)
               {
                  MessageBox.Show(this, "Serialized Copies must be an integer greater than or equal to 1.", appName);
               }
               else
               {
                  format.PrintSetup.NumberOfSerializedLabels = copies;
               }
            }

            // If there are no incorrect values in the copies boxes then print.
            if (success)
            {
               Cursor.Current = Cursors.WaitCursor;

               // Get the printer from the dropdown and assign it to the format.
               if (cboPrinters.SelectedItem != null)
                  format.PrintSetup.PrinterName = cboPrinters.SelectedItem.ToString();

               Messages messages;
               int waitForCompletionTimeout = 10000; // 10 seconds
               Result result = format.Print(appName, waitForCompletionTimeout, out messages);
               string messageString = "\n\nMessages:";

               foreach (Seagull.BarTender.Print.Message message in messages)
               {
                  messageString += "\n\n" + message.Text;
               }

               if (result == Result.Failure)
                  MessageBox.Show(this, "Print Failed" + messageString, appName);
               else
                  MessageBox.Show(this, "Label was successfully sent to printer." + messageString, appName);
            }
         }

各种 各种打印机。斑马 佐腾 其它
可以根据 条码来设置 匹配码,匹配码再去排定模版。这样就可以扫码自动选择模版来打印标签了。在这里插入图片描述在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值