Home > Net >  Call the Bartender print label
Call the Bartender print label

Time:09-23

In the community with this code label printing, can play out, is out of paper just out of the paper need to wait about 50 seconds, good slow, printer is TSC - TT244pro, just learning c # don't understand, has been thinking about for a few days, is there any man know is what reason. Thank you

The namespace WinFormTest
{
Public partial class Form1: Form
{

BarTender. Application btapp;
BarTender. Format btformat;

Public _click ()
{
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, "");
}
The catch (Exception ex)
{
MessageBox. Show (" load BarTender instance failure!" );
}
}

Private void button1_Click (object sender, EventArgs e)
{
Btformat. PrintSetup. NumberSerializedLabels=1;//set copies
Btformat. SetNamedSubStringValue (" SN ", "123233");
Btformat. PrintOut (true, false);//the second parameter Settings are out of print properties;
Oook MessageBox. Show (" ");
}

Private void Form1_FormClosing (object sender, FormClosingEventArgs e)
{
Btformat. Close (BarTender. BtSaveOptions. BtDoNotSaveChanges);//exits whether save the tag
Btapp. Quit (BarTender. BtSaveOptions. BtSaveChanges);//exits with refund to exit the BarTender process
}


}
}

CodePudding user response:

Problems have been found, I put the wrong position code
  •  Tags:  
  • C#
  • Related