Code:
Private BarTender. Application btApp;//Bartender application example
Private BarTender. Format btFormat;//Bartender style
# region label print
Private void tsbdy_Click (object sender, EventArgs e)
{
BtApp=new BarTender. Application ();
Try
{
BtFormat=btApp. Formats. Open (System. Windows. Forms. Application. StartupPath + @ \ 1. BTW, false, "");
BtFormat. PrintSetup. IdenticalCopiesOfLabel=1;//copies
BtFormat. PrintSetup. NumberSerializedLabels=1;//number of sequence tags
BtFormat. SetNamedSubStringValue (" 01 CD, "textBox13. Text. The Trim ());
//btFormat. SetNamedSubStringValue (" 02 zl, "textBox5. Text. The Trim ());
BtFormat. SetNamedSubStringValue (" 03 lx, "textBox5. Text. The Trim ());
BtFormat. SetNamedSubStringValue (" 04 gg, "textBox6. Text. The Trim ());
BtFormat. SetNamedSubStringValue (" 05 tm, "textBox12. Text. The Trim ());
BtFormat. SetNamedSubStringValue (06 lx, textBox10. Text. The Trim ());
BtFormat. SetNamedSubStringValue (7 ps, textBox8. Text. The Trim ());
BtFormat. PrintOut (true, true);//the second false set properties when the print is out of print
BtFormat. Close (BarTender. BtSaveOptions. BtSaveChanges);//exits whether save the tag
BtApp. Quit (BarTender. BtSaveOptions. BtSaveChanges);//exits synchronous exit the bartender process
}
The catch (Exception ex)
{
MessageBox. Show (ex. Message);
}
}
#endregion
CodePudding user response:
Try this out:Process myprocess=new Process ();
Process [] KillmyProcess=Process. GetProcessesByName (" bartend. Exe ");
Foreach (Process Process in KillmyProcess)
{
Process. The Kill ();
}
Or the SDK can be used to print, don't call exe
CodePudding user response:
The