先用Bartender设计出模板标签,里面的值使用变量形式,通过后台给标签变量赋值并打印标签
BarTender.Application btApp;
BarTender.Format btFormat;
private void Form1_FormLoad(object sender, FormLoadEventArgs e)
{
//绑定模板btw
btApp = new BarTender.Application();
btFormat = new BarTender.Format();
btFormat = btApp.Formats.Open(System.IO.Directory.GetCurrentDirectory() + "\\Test.btw");
btFormat.PrintSetup.IdenticalCopiesOfLabel = 1;
btFormat.PrintSetup.NumberSerializedLabels = 1;
}
private void button1_Click(object sender, EventArgs e)
{
//赋值、打印
btFormat.SetNamedSubStringValue("label1", 值1);
btFormat.SetNamedSubStringValue("label2", 值2);
//... ...
btFormat.PrintOut(true, false);
<