跳到主要内容
版本:Next

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

请求参数

名称位置类型必选说明
templateDirectoryquerystring模板目录

返回示例

200 Response

["string"]

返回结果

状态码状态码含义说明数据模型
200OKSuccessInline

返回数据结构

3.2 GET 预览模板

GET /api/preview

请求参数

名称位置类型必选说明
templatePathquerystring模板文件

返回示例

200 Response

{}

返回结果

状态码状态码含义说明数据模型
200OKSuccessInline

返回数据结构

3.3 POST 检测连接

POST /api/check

请求参数

名称位置类型必选说明
printNamequerystring打印机名称

返回示例

200 Response

{"noProblem":true,"errorMsg":"string"}

返回结果

状态码状态码含义说明数据模型
200OKSuccessCMS.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"
}
}

请求参数

名称位置类型必选说明
bodybodyCMS.Plugin.MesSuite.Printer.PrintOptionsnone

返回示例

200 Response

{"noProblem":true,"errorMsg":"string"}

返回结果

状态码状态码含义说明数据模型
200OKSuccessCMS.Plugin.MesSuite.Printer.PrintResult

数据模型

CMS.Plugin.MesSuite.Printer.PrintOptions

{
"printJobName": "string",
"printerName": "string",
"printTemplate": "string",
"printNumber": 0,
"numberSerializedLabels": 0,
"printData": {
"property1": "string",
"property2": "string"
}
}

属性

名称类型必选约束中文名说明
printJobNamestring¦nullfalsenone打印任务名称
printerNamestring¦nullfalsenone打印机名称.
printTemplatestring¦nullfalsenone模板路径.
printNumberinteger(int32)falsenone打印份数
numberSerializedLabelsinteger(int32)falsenone按照该数量打印出连续序列号的标签
printDataobject¦nullfalsenone打印数据源
» additionalPropertiesstringfalsenonenone

CMS.Plugin.MesSuite.Printer.PrintResult

{
"noProblem": true,
"errorMsg": "string"
}

属性

名称类型必选约束中文名说明
noProblembooleanfalsenonenone
errorMsgstring¦nullfalsenonenone