BarTender Agent
1. Overview
- BarTender Agent is a BarTender Web printing service running as a Windows Service on Windows systems. Users can print BarTender documents through Print Agent from any computer connected to the Internet.
- BarTender Agent provides remote printing services (e.g., BarTender and LMES are not on the same computer, LMES needs to connect to BarTender Agent remotely via http to execute remote printing).
2. Installation
- Print Agent is included as an optional component in the LMES installation package and will not be installed automatically.
- Print Agent needs to be installed on the same server as BarTender. Print Agent calls the local BarTender application to execute printing tasks.
- You can download the installation package on the LMES system configuration page, or find the installation package in the CMS directory to install
$(CMSRootPath)\host\wwwroot\BarTender.Agent.exe. - Double-click the
BarTender.Agent.exeinstallation package to start the installation wizard, and complete the remaining steps in the wizard. - After installing Print Agent, you can enter
BarTender.Agentin Windows system services, find the corresponding service, and confirm whether it is in the "Running" state.
3. Interface Documentation
Base URLs: http://127.0.0.1:18500
3.1 GET Get Templates
GET /api/templates
Request Parameters
| Name | Position | Type | Required | Description |
|---|---|---|---|---|
| templateDirectory | query | string | No | Template directory |
Response Example
200 Response
["string"]
Return Result
| Status Code | Status Code Meaning | Description | Data Model |
|---|---|---|---|
| 200 | OK | Success | Inline |
Return Data Structure
3.2 GET Preview Template
GET /api/preview
Request Parameters
| Name | Position | Type | Required | Description |
|---|---|---|---|---|
| templatePath | query | string | No | Template file |
Response Example
200 Response
{}
Return Result
| Status Code | Status Code Meaning | Description | Data Model |
|---|---|---|---|
| 200 | OK | Success | Inline |
Return Data Structure
3.3 POST Check Connection
POST /api/check
Request Parameters
| Name | Position | Type | Required | Description |
|---|---|---|---|---|
| printName | query | string | No | Printer name |
Response Example
200 Response
{"noProblem":true,"errorMsg":"string"}
Return Result
| Status Code | Status Code Meaning | Description | Data Model |
|---|---|---|---|
| 200 | OK | Success | CMS.Plugin.MesSuite.Printer.PrintResult |
3.4 POST Print Document
POST /api/print
Body Request Parameters
{
"printJobName": "string",
"printerName": "string",
"printTemplate": "string",
"printNumber": 0,
"numberSerializedLabels": 0,
"printData": {
"property1": "string",
"property2": "string"
}
}
Request Parameters
| Name | Position | Type | Required | Description |
|---|---|---|---|---|
| body | body | CMS.Plugin.MesSuite.Printer.PrintOptions | No | none |
Response Example
200 Response
{"noProblem":true,"errorMsg":"string"}
Return Result
| Status Code | Status Code Meaning | Description | Data Model |
|---|---|---|---|
| 200 | OK | Success | CMS.Plugin.MesSuite.Printer.PrintResult |
Data Model
CMS.Plugin.MesSuite.Printer.PrintOptions
{
"printJobName": "string",
"printerName": "string",
"printTemplate": "string",
"printNumber": 0,
"numberSerializedLabels": 0,
"printData": {
"property1": "string",
"property2": "string"
}
}
Properties
| Name | Type | Required | Constraints | Chinese Name | Description |
|---|---|---|---|---|---|
| printJobName | string¦null | false | none | Print job name | |
| printerName | string¦null | false | none | Printer name | |
| printTemplate | string¦null | false | none | Template path | |
| printNumber | integer(int32) | false | none | Number of copies | |
| numberSerializedLabels | integer(int32) | false | none | Print serialized labels according to this quantity | |
| printData | object¦null | false | none | Print data source | |
| » additionalProperties | string | false | none | none |
CMS.Plugin.MesSuite.Printer.PrintResult
{
"noProblem": true,
"errorMsg": "string"
}
Properties
| Name | Type | Required | Constraints | Chinese Name | Description |
|---|---|---|---|---|---|
| noProblem | boolean | false | none | none | |
| errorMsg | string¦null | false | none | none |