Printer command overview
Thermal printers are controlled through specific command sets rather than the driver model used by graphical printers.
Command language
Section titled “Command language”| Command | Type | Primary use |
|---|---|---|
| CPCL | Text commands | Portable label printing |
| ESC | Binary commands | Thermal receipt printing |
| ESC/POS | Binary commands | POS system printing |
| TSPL | Text commands | Label and barcode printing |
Command architecture differences
Section titled “Command architecture differences”Command format
Section titled “Command format”- Text commands (CPCL/TSPL): Human-readable text that is easy to debug
- Binary commands (ESC/ESC-POS): Compact hexadecimal byte sequences
Parameter separators
Section titled “Parameter separators”- CPCL: Parameters are separated by spaces
- TSPL: Parameters are separated by commas
Encoding considerations
Section titled “Encoding considerations”Choosing an SDK
Section titled “Choosing an SDK”Label printing
Section titled “Label printing”- If the printer supports CPCL, prefer CPCL for readability
- If the printer only supports TSPL, use TSPL
Receipt printing
Section titled “Receipt printing”- Use ESC/POS, the industry standard with the best compatibility
SDK integration
Section titled “SDK integration”For command usage in each programming language, see the SDK overview:
- Dart SDK - Cross-platform Flutter development
- Java SDK - Native Android development
- JavaScript SDK - Mini Program development
- Objective-C SDK - Native iOS development
- Swift SDK - iOS/macOS development