C#调用把BarTender模板

上传人:re****.1 文档编号:505029502 上传时间:2024-01-02 格式:DOCX 页数:20 大小:234.96KB
返回 下载 相关 举报
C#调用把BarTender模板_第1页
第1页 / 共20页
C#调用把BarTender模板_第2页
第2页 / 共20页
C#调用把BarTender模板_第3页
第3页 / 共20页
C#调用把BarTender模板_第4页
第4页 / 共20页
C#调用把BarTender模板_第5页
第5页 / 共20页
点击查看更多>>
资源描述

《C#调用把BarTender模板》由会员分享,可在线阅读,更多相关《C#调用把BarTender模板(20页珍藏版)》请在金锄头文库上搜索。

1、1、应用 命名空间,2、代码如下:using System;using ;using System ponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;/using ;using ;using ;/using Seagull.BarTender;namespace BarTenderPrintTest1 public partial class Form1 : Form public Form1 InitializeComponent; /Bar string dc = D

2、:lipingBartenderPrintBarTenderPrintTest1BarTenderPrintTest1binDebugHW_CaiHe_and_packbox.btw;intff = 163704004; string aa = 00057616-;int i = 1; private void btn_print_Click PrintLabel3; #region 第一种写法 private void PrintLabel1 /创建一个BarTender打印引擎 ,并启用 Engine engine = new Engine; /创建一个模板对象 /LabelFormatD

3、ocument format = engine.Documents.Open;LabelFormatDocument format = engine.Documents.Open;format.Print; /format.Print; /format.Close;format.Print;engine.Dispose; #endregion #region 打印第二种方法 private void PrintLable2 using Engine engine = new Engine /启用一个打印引擎engine.Start; /创建一个模板对象 LabelFormatDocument

4、format = engine.Documents.Open; /打印 /format.Print; /改变标签打印数份连载 =1; /设定印标签打印数量 = 1; Result nResult = format.Print; /指定打印机打印,不指定则使用默认打印机 = Bar Code Printer T-4503E; / Display the print result. /Console.WriteLine;MessageBox.Show; / Close the current format without saving. /SaveOptions 有三个值 DoNotSaveCha

5、nges:不保存 ,PromptSave:提示是否保存 SaveChanges:保存format.Close; /结束打印引擎engine.Stop; #endregion #region 第三种打印方法改变标签的值private void PrintLabel3 using Engine engine = new Engine LabelFormatDocumentbtFormat = ; /MessageBox.Show; /获取标签的值 /string AddressSubstring = btFormat.SubStringsHWbarcode1.Value; /MessageBox.

6、Show; /修改标签的值 /btFormat.SubStringsAddress.Value = 1313 Mockingbird Lane, Anywhere, USA; /btFormat.SubStringsName.Value = John Doe; /btFormat.SubStringsQuantity.Value = 10; intdd = ff + i; i+;btFormat.SubStringsHWbarcode1.Value = aa+dd.ToString ; /改变标签打印数份连载 = 1; /设定印标签打印数量 = 1; Result nResult = btFo

7、rmat.Print; /指定打印机打印,不指定则使用默认打印机 = Bar Code Printer T-4503E;MessageBox.Show;btFormat.Close; /结束打印引擎engine.Stop; #endregion 三、bartender 说明文档部分Creating a BarTender Print EngineThe Engine class represents a BarTender process and provides the backbone for programming with the BarTender Print SDK. All pr

8、ograms written with the BarTender Print SDK will rely on the Engine class to provide BarTender print functionality. The BarTender Print EngineThe BarTender process provides standard BarTender functionality, such as opening label formats, changing label settings, and printing. The BarTender backgroun

9、d process is controlled using an instance of the Engine class. The Role of the Engine ClassThe Engine class contains many methods, properties, and events to assist in printing and controlling the BarTender Print Engine. Features of the Engine ClassThe Engine class allows users to: Start, stop, and r

10、estart a BarTender background process. Open, access, and save label formats. Use Engine-level events to monitor printing. Manage the BarTender Application window.How To: Start and Stop an EngineAn engine must be created and started in order to launch a BarTender process and commence printing. The En

11、gine class provides the Engine.Stop method to explicitly shut down the BarTender Print Engine. If the engine is not stopped, a bartend.exe process may be left running in the background. After calling the Engine.Stop method, it is best practice to call the Engine.Dispose method. The Dispose method ensures all non-memory resources are properly released for t

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 建筑/环境 > 施工组织

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号