Bartender打印和导出图片
来源:互联网 发布:网络基础知识ppt 编辑:程序博客网 时间:2024/05/20 14:42
1.Bartender打印
try
{BarTender.Application btApp = new BarTender.Application();
BarTender.Format btFormat;
string tagTemplatesPath = Path.Combine(Application.StartupPath, "testlabel.btw");
btFormat = btApp.Formats.Open(tagTemplatesPath, false, "");//D:\testlabel\testlabel.btw
btFormat.PrintSetup.IdenticalCopiesOfLabel = 1; //设置同序列打印的份数
//btFormat.Databases.QueryPrompts.GetQueryPrompt(0);//根据数据库数据打印
//这个是序列化打印时使用的,当你的标签启动了序列化后,这个属性代表的就是打印的份数,譬如你的序列化初始数据是1,增量为1,NumberSerializedLabels设置为5,那么就会打印出1、2、3、4、5,五个标签出来。
//btFormat.PrintSetup.NumberSerializedLabels = 2; //设置需要打印的序列数
btFormat.SetNamedSubStringValue("Label_data01", DateTime.Now.ToString("HHmmss")); //向bartender模板传递变量
btFormat.PrintOut(false, false); //第二个false设置打印时是否跳出打印属性
//BarTender.Messages msg;
//int waitout = 10000; // 10秒 超时
//btFormat.Print("任务名1", true, waitout, out msg);//打印的任务名,是否等待打印完成,等待超时时间,打印过程输出的信息。
btFormat.Close(BarTender.BtSaveOptions.btSaveChanges); //退出时是否保存标签
btApp.Quit(BarTender.BtSaveOptions.btSaveChanges);//界面退出时同步退出bartender进程
}
catch (Exception ex)
{
string path = Path.Combine(Application.StartupPath, "printlog.txt");
File.AppendAllText(path, "异常:" + ex.Message + "。\r\n" + DateTime.Now + "\r\n");
MessageBox.Show(ex.Message);
}
2.bartender导出图片
BarTender.Format btFormat;
BarTender.Application btApp;
btFormat = new BarTender.Format();
btApp = new BarTender.Application();
string file = HttpContext.Current.Server.MapPath("/templatefile/testlabel.btw");
btFormat = btApp.Formats.Open(file, false, "");
btFormat.PrintSetup.NumberSerializedLabels = 1;
btFormat.SetNamedSubStringValue("Label_data01",DateTime.Now.ToString("mmss"));
btFormat.SaveAs(file, true);
btFormat.ExportToFile(HttpContext.Current.Server.MapPath("/templatefile/BarCodeTable.jpg"), "jpg", BarTender.BtColors.btColors24Bit, BarTender.BtResolution.btResolutionPrinter, BarTender.BtSaveOptions.btSaveChanges);
Image1.ImageUrl = "~/templatefile/BarCodeTable.jpg";
btApp.Quit(BarTender.BtSaveOptions.btDoNotSaveChanges);
//打印
btFormat = btApp.Formats.Open(file, false, "");
//同一个条码,打印5个
//btFormat.PrintSetup.IdenticalCopiesOfLabel = 5;
//条码递增+1
//btFormat.PrintSetup.NumberSerializedLabels = 4;
btFormat.PrintOut(false, false);
btApp.Quit(BarTender.BtSaveOptions.btDoNotSaveChanges);
- Bartender打印和导出图片
- c# BarTender打印
- bartender打印错误
- Delphi 调用BarTender打印条码
- c# 使用bartender sdk 打印
- BarTender如何打印额外字符
- C#打印条码BarTender SDK
- C#使用BarTender打印Label
- Delphi 调用BarTender打印条码
- [C#]调用Bartender服务并打印bartender标签
- 导出Excel和打印
- BarTender批量打印标签的教程
- javaScript 预览图片,base64导出报表,打印
- C#图片和打印
- bartender条码打印软件2016下载 v11.0.3.1046
- 使用Delphi调用条形码控件BarTender打印标签
- BarTender打印出来的条码与设计的不同咋办
- BarTender出现条码打印位置不准的情况怎么办
- 【题解】局域网(net)
- 用Gvim建立IDE编程环境 (Windows篇)
- 【题解】cooking
- exit和return的区别
- 代码的抽象三原则
- Bartender打印和导出图片
- 【题解】最短路径四题
- 设计模式中类的关系
- 【转载】树状数组(简单)
- 上一个十年,下一个十年
- 【kuandui】二叉堆
- 对付内存改写问题的银弹
- 【最短路径】Floyd算法
- MIPS架构培训之Cache原理