BarTender Agent
1.概述
- BarTender Agent是一个BarTender Web打印服务,在Windows系统上作为Windows Service运行,用户可以从任何一台连入互联网的计算机通过Print Agent 打印BarTender文档。
- BarTender Agent提供远程打印服务(如:BarTender和LMES不在同一台电脑,LMES需要通过http远程连接BarTender Agent,执行远程打印)。
2.安装
- Print Agent 作为可选组件包含在LMES安装包中,不会自动安装。
- Print Agent 需要和BarTender安装在同一台服务器上,Print Agent 调用本地BarTender应用执行打印任务。
- 可在LMES系统配置页面,下载安装包,或者在CMS目录下找到安装包安装 $(CMSRootPath)\host\wwwroot\BarTender.Agent.exe
- 双击BarTender.Agent.exe安装包,安装向导启动,完成向导中的其余步骤。
- 安装Print Agent后,可以在Windows系统服务中输入BarTender.Agent,找到对应的服务,并确认是否处于 “正在运行” 状态。
3.接口文档
Base URLs:http://127.0.0.1:18500
3.1 GET 获取模板
GET /api/templates
请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 |
|---|---|---|---|---|
| templateDirectory | query | string | 否 | 模板目录 |
返回示例
200 Response
["string"]
返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | Success | Inline |
返回数据结构
3.2 GET 预览模板
GET /api/preview
请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 |
|---|---|---|---|---|
| templatePath | query | string | 否 | 模板文件 |
返回示例
200 Response
{}
返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | Success | Inline |
返回数据结构
3.3 POST 检测连接
POST /api/check
请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 |
|---|---|---|---|---|
| printName | query | string | 否 | 打印机名称 |
返回示例
200 Response
{"noProblem":true,"errorMsg":"string"}
返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | Success | CMS.Plugin.MesSuite.Printer.PrintResult |
3.4 POST 打印文档
POST /api/print
Body 请求参数
{
"printJobName": "string",
"printerName": "string",
"printTemplate": "string",
"printNumber": 0,
"numberSerializedLabels": 0,
"printData": {
"property1": "string",
"property2": "string"
}
}
请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 |
|---|---|---|---|---|
| body | body | CMS.Plugin.MesSuite.Printer.PrintOptions | 否 | none |
返回示例
200 Response
{"noProblem":true,"errorMsg":"string"}
返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | Success | CMS.Plugin.MesSuite.Printer.PrintResult |
数据模型
CMS.Plugin.MesSuite.Printer.PrintOptions
{
"printJobName": "string",
"printerName": "string",
"printTemplate": "string",
"printNumber": 0,
"numberSerializedLabels": 0,
"printData": {
"property1": "string",
"property2": "string"
}
}
属性
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| printJobName | string¦null | false | none | 打印任务名称 | |
| printerName | string¦null | false | none | 打印机名称. | |
| printTemplate | string¦null | false | none | 模板路径. | |
| printNumber | integer(int32) | false | none | 打印份数 | |
| numberSerializedLabels | integer(int32) | false | none | 按照该数量打印出连续序列号的标签 | |
| printData | object¦null | false | none | 打印数据源 | |
| » additionalProperties | string | false | none | none |
CMS.Plugin.MesSuite.Printer.PrintResult
{
"noProblem": true,
"errorMsg": "string"
}
属性
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| noProblem | boolean | false | none | none | |
| errorMsg | string¦null | false | none | none |