在社區用這個代碼列印標簽,能打出來,就是出紙要等50秒左右才出紙,好慢,列印機是TSC-TT244pro,剛學C# 不太懂,已經琢磨好幾天了,有沒有好心人知道是什么原因.謝謝
namespace WinFormTest
{
public partial class Form1 : Form
{
BarTender.Application btapp;
BarTender.Format btformat;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
try
{
btapp = new BarTender.Application();
btformat = btapp.Formats.Open(@"D:\Users\amaris.ma\Desktop\opp\opp\G05_TRAY2.btw", false, "");
}
catch (Exception ex)
{
MessageBox.Show("加載BarTender實體失敗!");
}
}
private void button1_Click(object sender, EventArgs e)
{
btformat.PrintSetup.NumberSerializedLabels = 1; //設定列印份數
btformat.SetNamedSubStringValue("SN", "123233");
btformat.PrintOut(true, false); //第二個引數設定是否跳出列印屬性;
MessageBox.Show("oook");
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
btformat.Close(BarTender.BtSaveOptions.btDoNotSaveChanges); //退出時是否保存標簽
btapp.Quit(BarTender.BtSaveOptions.btSaveChanges);//退出時同退退出BarTender行程
}
}
}
uj5u.com熱心網友回復:
問題已經找到了,我代碼放錯位置了
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/112052.html
標籤:C#
