Home > Net >  Call 300 for help: BarTender print label, printed after the "BarTender" background process
Call 300 for help: BarTender print label, printed after the "BarTender" background process

Time:11-27

After the call the BarTender print label, print "BarTender" background processes can't quit, I have written the code closing process, each point of a print will add a background process, it'll save the program card dead, how should solve?
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
Hello World, 1/f, reference response:
try out like this:
 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

How to call the SDK print, novice, have the document

CodePudding user response:

Consult the

CodePudding user response:

Is there a better way, such as online

CodePudding user response:

Winform not have own print control?

PrintDocument controls should be able to implement

Consult
https://www.cnblogs.com/Julyzjc/p/9360463.html

CodePudding user response:

Never used this print control,
Make a single case?
  •  Tags:  
  • C#
  • Related