14Label Print Service (Background Service)
The Label Print Service is a standalone background program independent from the main designer. Think of it as a "print server" β it runs 24/7, waiting to receive print jobs.
- Batch automatic printing without manual intervention
- Other software (ERP, MES) sends print commands over the network
- Print jobs need queue management (queuing, retry, throttling)
- Remote monitoring of print status
14.1 Starting and Stopping
| Action | Method |
|---|---|
| Start service | Double-click AbiaoLabelPrintService.exe. No window appears β only a printer icon in the system tray (bottom right). |
| Confirm it's running | Look for the printer icon in the system tray; check the overflow area if hidden. |
| Stop service | Right-click tray icon β "Exit". |
| Auto-start on boot | Right-click tray icon β "Settings" β check "Auto-start on boot". |
14.2 Three Receiving Channels
The Print Service offers 3 ways to receive print jobs:
β TCP Channel (Port 8888)
The most direct method. Any program or device can send ZPL commands via TCP to port 8888.
Use cases:
- LAN scanning devices sending print commands directly
- Production line terminals sending label data
- Low-latency, high-efficiency printing needed
β‘ HTTP REST API (Port 5000)
The most common method. Send print jobs via standard HTTP requests β callable from any language (C#, Java, Python, PHP, etc.).
Management dashboard: Open http://localhost:5000 in a browser to see the service status page.
Available API endpoints:
| Method | Endpoint | Purpose |
|---|---|---|
| GET | http://localhost:5000/ | Open service status web page |
| POST | http://localhost:5000/print | Send ZPL command to print a label |
| GET | http://localhost:5000/queue | View current print queue |
| DELETE | http://localhost:5000/queue/{taskId} | Cancel a queued job |
| GET | http://localhost:5000/history | View print history |
| DELETE | http://localhost:5000/history | Clear all history |
| POST | http://localhost:5000/shutdown | Remotely stop the print service |
Python example:
import requests, json
zpl_data = "^XA^FO50,50^ADN,36,20^FDHello World^FS^XZ"
task = {
"zpl": zpl_data,
"copies": 2,
"printer": "ZDesigner ZD421",
"priority": 0
}
resp = requests.post("http://localhost:5000/print", json=task)
print(resp.json()) # {"success": true, "taskId": "..."}
curl test:
curl -X POST http://localhost:5000/print ^
-H "Content-Type: application/json" ^
-d "{\"zpl\":\"^XA^FO50,50^ADN,36,20^FDHello^FS^XZ\",\"copies\":1}"
β’ Directory Monitoring
The service watches a specified folder. When .zpl or .iba files arrive, it automatically queues them for printing.
- Success: file moves to
.processedsubfolder - Failure: file moves to
.failedsubfolder - Great for integration β other systems just drop ZPL files in the folder
14.3 Print Queue Management
When multiple jobs arrive simultaneously, the service queues them:
- FIFO: Default first-in-first-out ordering
- Priority: Set priority (0=highest, higher number = lower priority)
- Auto retry: Automatic retry on failure (default 3 retries, 5 seconds apart)
- Throttling: Set minimum interval between jobs (prevents printer overload)
- Pause/Resume: Temporarily pause the queue (e.g. for ribbon change)
- Persistence: Queue persists to disk β no job loss after service restart
14.4 Settings Management
Right-click the tray printer icon β "Settings":
| Setting | Default | Description |
|---|---|---|
| TCP Port | 8888 | TCP listen port |
| HTTP Port | 5000 | HTTP API port |
| Watch Directory | (empty) | Folder path to monitor, e.g. D:\PrintJobs\ |
| Default Printer | (system default) | Default printer when unspecified |
| Retry Count | 3 | Retries on failure (0=no retry) |
| Retry Interval | 5 seconds | Wait between retries |
| Throttle Interval | 200 ms | Minimum gap between jobs |
| Auto Start | Off | Start automatically with Windows |
| Queue Storage Path | (default) | Where queue persistence files are stored |
14.5 Conditional Rules (Advanced)
Rules can intelligently process print jobs based on their content.
Rule examples:
- Content-based routing: "Shanghai" orders β Warehouse A printer; "Beijing" orders β Warehouse B printer
- Source-based routing: HTTP jobs use fast lane, directory jobs use batch lane
- Filtering: Discard certain labels without printing
- Content modification: Prepend fixed header/footer to ZPL commands
- Quantity modification: Auto-print an extra copy for certain label types
Rule structure:
- Condition: When to match (field value match / ZPL content match / source match)
- Action: What to do on match (route printer / block printing / modify content / modify copies)
Rules are evaluated top-to-bottom; the first match stops evaluation.
14.6 System Tray Operations
Find the printer icon near the clock:
- Double-click left: Open management dashboard in browser (http://localhost:5000)
- Right-click menu:
β£ Open Dashboard
β£ Show Window (service control window)
β£ Pause/Resume Printing
β£ Settings
β£ About
β Exit
14.7 COM Component Support (Legacy Compatibility)
If your organization still uses VB6, VBA (Excel macros), or other legacy technologies, you can call the print service via COM:
Dim service As Object
Set service = CreateObject("PrintServiceComServer")
service.PrintZPL "^XA...^XZ", "ZDesigner ZD421", 1