| Paper Width | Printable Pixels | Cutter | Use Case |
|---|---|---|---|
| 80mm | 576px | �Some models | Retail/restaurant receipts |
| 58mm | 384px | � | Handheld mobile printing |
| SDK Version | Android Version | Notes |
|---|---|---|
| SDK 2.0 | Android 13+ | Full feature set, recommended for new projects |
| SDK 1.0 | Android 11 and below | Basic printing features |
| Method | Description | SDK |
|---|---|---|
initPrinter() |
Initialize printer | 1.0+ |
getPrinterStatus() |
Get printer status | 1.0+ |
getSdkVersion() |
Get SDK version | 1.0+ |
initPrinterParams() |
Reset print parameters to defaults | 1.0+ |
resetDevice() |
Restart printer | 1.0+ |
unBindService() |
Unbind print service | 1.0+ |
printerSelfChecking() |
Print self-test page | 1.0+ |
openLogs(int) |
Toggle logging | 1.0+ |
| Method | Description | SDK |
|---|---|---|
printText(String, {IminTextStyle?}) |
Print text (auto-routes to bitmap on 2.0 when style is provided) | 1.0+ |
printAntiWhiteText(String, {IminTextStyle?}) |
Print reverse text | 1.0+ |
printTextBitmap(String, {IminTextPictureStyle?}) |
Print text as bitmap | 1.0+ |
printColumnsText({List<ColumnMaker>}) |
Print table row | 1.0+ |
printColumnsString({List<ColumnMaker>}) |
Print table row (string mode) | 1.0+ |
printTextWithAli(String, int) |
Print text with alignment | 2.0 |
printTextWithEncode(String, String) |
Print text with encoding | 2.0 |
printEscPosText(String, {IminEscPosTextStyle?}) |
ESC/POS text printing | 2.0 |
| Method | Description | SDK |
|---|---|---|
setTextSize(int) |
Set font size | 1.0+ |
setTextTypeface(IminTypeface) |
Set typeface | 1.0+ |
setTextStyle(IminFontStyle) |
Set font style | 1.0+ |
setAlignment(IminPrintAlign) |
Set alignment | 1.0+ |
setTextWidth(int) |
Set text width | 1.0+ |
setTextLineSpacing(double) |
Set line spacing | 1.0+ |
| Method | Description | SDK |
|---|---|---|
setTextBitmapTypeface(IminTypeface) |
Bitmap typeface | 1.0+ |
setTextBitmapSize(int) |
Bitmap font size | 1.0+ |
setTextBitmapStyle(IminFontStyle) |
Bitmap font style | 1.0+ |
setTextBitmapStrikeThru(bool) |
Bitmap strikethrough | 1.0+ |
setTextBitmapUnderline(bool) |
Bitmap underline | 1.0+ |
setTextBitmapLineSpacing(double) |
Bitmap line spacing | 1.0+ |
setTextBitmapLetterSpacing(double) |
Bitmap letter spacing | 1.0+ |
setTextBitmapAntiWhite(bool) |
Bitmap reverse white | 1.0+ |
| Method | Description | SDK |
|---|---|---|
setFontMultiple(int, int) |
Width/height multiple | 2.0 |
setFontBold(bool) |
Bold | 2.0 |
setFontItalic(bool) |
Italic | 2.0 |
setFontAntiWhite(bool) |
Reverse white | 2.0 |
setFontUnderline(int) |
Underline | 2.0 |
setFontRotate(int) |
Rotation | 2.0 |
setFontDirection(int) |
Print direction | 2.0 |
setFontLineSpacing(int) |
Line spacing | 2.0 |
setFontCharSpace(int) |
Character spacing | 2.0 |
setFontChineseSpace(int, int) |
Chinese character spacing | 2.0 |
setFontChineseSize(int, int, int, int) |
Chinese font size | 2.0 |
setFontCharSize(int, int, int, int) |
ASCII font size | 2.0 |
setFontChineseMode(int) |
Chinese mode | 2.0 |
setFontCountryCode(int) |
Set country code | 2.0 |
getFontCountryCode() |
Get country code list | 2.0 |
| Method | Description | SDK |
|---|---|---|
printSingleBitmap(dynamic, {IminPictureStyle?}) |
Print single image | 1.0+ |
printSingleBitmapWithTranslation(dynamic, {IminPictureStyle?}) |
Print single image (with translation) | 1.0+ |
printMultiBitmap(List, {IminPictureStyle?}) |
Print multiple images | 1.0+ |
printSingleBitmapBlackWhite(dynamic, {IminBaseStyle?}) |
Print black & white image | 1.0+ |
printSingleBitmapColorChart(dynamic, {IminPictureStyle?}) |
Print color chart | 1.0+ |
| Method | Description | SDK |
|---|---|---|
printBarCode(IminBarcodeType, String, {IminBarCodeStyle?}) |
Print barcode | 1.0+ |
printBarCodeToBitmapFormat(String, int, int, IminBarCodeToBitmapFormat) |
Bitmap format barcode | 1.0+ |
setBarCodeWidth(int) |
Barcode width | 1.0+ |
setBarCodeHeight(int) |
Barcode height | 1.0+ |
setBarCodeContentPrintPos(IminBarcodeTextPos) |
HRI character position | 1.0+ |
| Method | Description | SDK |
|---|---|---|
printQrCode(String, {IminQrCodeStyle?}) |
Print QR code | 1.0+ |
setQrCodeSize(int) |
QR code size | 1.0+ |
setQrCodeErrorCorrectionLev(IminQrcodeCorrectionLevel) |
Error correction level | 1.0+ |
setLeftMargin(int) |
Left margin | 1.0+ |
setCodeAlignment(IminPrintAlign) |
Code alignment | 1.0+ |
printDoubleQR({IminDoubleQRCodeStyle, IminDoubleQRCodeStyle, int?}) |
Double QR code | 1.0+ |
setDoubleQRSize(int) |
Double QR size | 1.0+ |
setDoubleQR1Level(int) / setDoubleQR2Level(int) |
Double QR error level | 1.0+ |
setDoubleQR1MarginLeft(int) / setDoubleQR2MarginLeft(int) |
Double QR left margin | 1.0+ |
setDoubleQR1Version(int) / setDoubleQR2Version(int) |
Double QR version | 1.0+ |
| Method | Description | SDK |
|---|---|---|
print2DCode(String, int, int, int, int) |
Generic 2D code | 2.0 |
printPDF417(String, int, int, int, int, int, int, int) |
PDF417 code | 2.0 |
printDataMatrix(String, int, int, int, int, int) |
DataMatrix code | 2.0 |
printAztecCode(String, int, int, int, int, int) |
Aztec code | 2.0 |
printMaxiCode(String, int, int) |
MaxiCode | 2.0 |
| Method | Description | SDK |
|---|---|---|
printAndLineFeed() |
Feed one line | 1.0+ |
printAndFeedPaper(int) |
Feed paper by height (1-1016) | 1.0+ |
setPageFormat({int?}) |
Set paper format 0=80mm 1=58mm | 1.0+ |
partialCut() |
Partial cut | 1.0+ |
fullCut() |
Full cut | 1.0+ |
printAndQuitPaper(int) |
Print and retract paper | 2.0 |
partialCutAndFeedPaper(int) |
Partial cut and feed | 2.0 |
fullCutAndFeedPaper(int) |
Full cut and feed | 2.0 |
| Method | Description | SDK |
|---|---|---|
enterPrinterBuffer(bool) |
Enter buffer mode | 1.0+ |
commitPrinterBuffer() |
Commit buffer | 1.0+ |
exitPrinterBuffer(bool) |
Exit buffer mode | 1.0+ |
commitPrinterBufferWithCallback() |
Commit buffer (with callback) | 2.0 |
exitPrinterBufferWithCallback(bool) |
Exit buffer (with callback) | 2.0 |
| Method | Description | SDK |
|---|---|---|
labelInitCanvas({LabelCanvasStyle?}) |
Initialize label canvas | 1.0+ |
labelAddText(String, {LabelTextStyle?}) |
Add text | 1.0+ |
labelAddBarCode(String, {LabelBarCodeStyle?}) |
Add barcode | 1.0+ |
labelAddQrCode(String, {LabelQrCodeStyle?}) |
Add QR code | 1.0+ |
labelAddArea({LabelAreaStyle?}) |
Add shape/area | 1.0+ |
labelAddBitmap(dynamic, {LabelBitmapStyle?}) |
Add image | 1.0+ |
labelPrintCanvas(int) |
Print label canvas | 1.0+ |
printLabelBitmap(dynamic, {LabelPrintBitmapStyle?}) |
Print label bitmap | 1.0+ |
labelLearning() |
Label learning | 1.0+ |
setPrintModel(int) |
Set print mode 0=thermal 1=label | 1.0+ |
labelPrintBitmapDirect(Uint8List, int, int) |
Direct label bitmap print | 2.0 |
labelGapSensorCalibration() |
Gap sensor calibration | 2.0 |
labelSetPrinterMode(int) |
Set label printer mode | 2.0 |
labelQueryInfo(IminLabelInfo) |
Query label info | 2.0 |
labelRestoreDefaults() |
Restore label defaults | 2.0 |
setLabelContinuousPrint(bool) |
Continuous label print | 2.0 |
| Method | Description | SDK |
|---|---|---|
openCashBox() |
Open cash drawer | 1.0+ |
getDrawerStatus() |
Drawer status | 1.0+ |
getOpenDrawerTimes() |
Open drawer count | 1.0+ |
supportCashBox() |
Check cash drawer support | 2.0 |
| Method | Description | SDK |
|---|---|---|
getPrinterSerialNumber() |
Serial number | 1.0+ |
getPrinterModelName() |
Model name | 1.0+ |
getPrinterThermalHead() |
Thermal head model | 1.0+ |
getPrinterFirmwareVersion() |
Firmware version | 1.0+ |
getPrinterHardwareVersion() |
Hardware version | 1.0+ |
getServiceVersion() |
Service version | 1.0+ |
getUsbPrinterVidPid() |
USB VID/PID | 1.0+ |
getUsbDevicesName() |
USB device name | 1.0+ |
getPrinterDensity() |
Print density | 1.0+ |
getPrinterPaperDistance() |
Paper distance | 1.0+ |
getPrinterPaperType() |
Paper type | 1.0+ |
getPrinterCutTimes() |
Cut count | 1.0+ |
getPrinterMode() |
Printer mode | 1.0+ |
getPrinterTemperature() |
Print head temperature | 2.0 |
getPrinterSupplierName() |
Supplier name | 2.0 |
getPrinterPatternList() |
Pattern list | 2.0 |
getPrinterKnifeReset() |
Knife reset | 2.0 |
| Method | Description | SDK |
|---|---|---|
getPrinterDensityList() |
Available density list | 1.0+ |
getPrinterSpeedList() |
Available speed list | 1.0+ |
setPrinterSpeed(int) |
Set speed | 1.0+ |
getPrinterSpeed() |
Get speed | 1.0+ |
getPrinterPaperTypeList() |
Available paper type list | 1.0+ |
getFontCodepage() |
Font codepage list | 1.0+ |
setFontCodepage(int) |
Set codepage | 1.0+ |
getCurCodepage() |
Current codepage | 1.0+ |
getEncodeList() |
Encoding list | 1.0+ |
getCurEncode() |
Current encoding | 1.0+ |
setPrinterEncode(int) |
Set encoding | 1.0+ |
setInitIminPrinter(bool) |
Set default printer | 1.0+ |
| Method | Description | SDK |
|---|---|---|
setPrinterAction(String, String) |
Generic setting | 2.0 |
setPrinterActionList(String, List<String>) |
Generic setting (list) | 2.0 |
getPrinterInfoByKey(String) |
Generic query | 2.0 |
getPrinterInfoList(String) |
Generic query (list) | 2.0 |
getPrinterInfoString(String) |
Generic query (string) | 2.0 |
| Method | Description | SDK |
|---|---|---|
sendRAWData(Uint8List) |
Send raw byte data | 1.0+ |
sendRAWDataHexStr(String) |
Send hex string | 1.0+ |
regesiterPrinterStatusCallback() |
Register status callback | 2.0 |
receiveBroadcastStream |
Status event stream (EventChannel) | 1.0+ |
Initialize the printer. Must be called before any print operation.
- Returns:
Future<bool?>
await iminPrinter.initPrinter();Get printer status.
- Returns:
Future<Map<String, dynamic>>�containscodeandmsgfields
Status Codes:
| code | Meaning | Action |
|---|---|---|
| -1 | Initialization failed | Check connection, restart app |
| 0 | Normal | - |
| 1 | Not connected / not powered on | Check power and connection |
| 2 | Printer and library mismatch | Update SDK or firmware |
| 3 | Print head open | Close printer cover |
| 4 | Cutter not reset | Reset cutter mechanism |
| 5 | Print head overheated | Wait for cooling |
| 6 | Black label error | Check label type |
| 7 | Paper missing | Install paper roll |
| 8 | Paper running out | Prepare replacement |
| 99 | Other error | Check logs |
Map<String, dynamic> status = await iminPrinter.getPrinterStatus();
if (status['code'] == '0') {
print('Printer ready');
} else {
print('Error: ${status['msg']}');
}Get SDK version. Returns "1.0.0" or "2.0.0".
- Returns:
Future<String?>
String? version = await iminPrinter.getSdkVersion();Reset print parameters to defaults (font, alignment, style, etc.). Does not clear buffer data.
await iminPrinter.initPrinterParams();Restart the printer device.
await iminPrinter.resetDevice();Unbind the print service.
await iminPrinter.unBindService();Print a self-test page.
await iminPrinter.printerSelfChecking();Toggle print logging.
| Param | Type | Description |
|---|---|---|
| open | int | 1=enable, 0=disable |
await iminPrinter.openLogs(1);Print text.
⚠� SDK 2.0 behavior: When
styleis provided, this method automatically routes toprintTextBitmap(bitmap path) on 2.0 devices, because 2.0's native printText uses ESC/POS commands that don't recognize setTextSize etc. Withoutstyle, it uses native ESC/POS commands.
| Param | Type | Required | Description |
|---|---|---|---|
| text | String | � | Text content |
| style | IminTextStyle | - | Text style |
IminTextStyle properties:
| Property | Type | Description |
|---|---|---|
| fontSize | int? | Font size |
| fontStyle | IminFontStyle? | normal / bold / italic / boldItalic |
| typeface | IminTypeface? | Typeface |
| align | IminPrintAlign? | left / center / right |
| width | int? | Text width (pixels) ⚠� Only effective on 1.0 devices |
| space | double? | Line spacing ⚠� Only effective on 1.0 devices |
| wordWrap | bool? | Auto line wrap ⚠� Only effective in printAntiWhiteText |
⚠� On 2.0 devices, only
fontSize,fontStyle,typeface, andalignare effective when style is provided (bitmap path).width,space, andwordWrapare not passed through.
// Simple print
await iminPrinter.printText('Hello World');
// With style
await iminPrinter.printText('Title',
style: IminTextStyle(
fontSize: 32,
fontStyle: IminFontStyle.bold,
align: IminPrintAlign.center,
),
);Print reverse text (white text on black background). Same parameters as printText.
await iminPrinter.printAntiWhiteText('Reverse Text',
style: IminTextStyle(fontSize: 28, align: IminPrintAlign.center),
);Print text as bitmap with richer style control.
| Param | Type | Required | Description |
|---|---|---|---|
| text | String | � | Text content |
| style | IminTextPictureStyle | - | Bitmap text style |
IminTextPictureStyle properties:
| Property | Type | Description |
|---|---|---|
| fontSize | int? | Font size |
| fontStyle | IminFontStyle? | Font style |
| typeface | IminTypeface? | Typeface |
| align | IminPrintAlign? | Alignment |
| letterSpacing | double? | Letter spacing |
| underline | bool? | Underline |
| throughline | bool? | Strikethrough |
| lineHeight | double? | Line height |
| reverseWhite | bool? | Reverse white |
wordWrapexists in the class definition but is not used in theprintTextBitmapimplementation. Passing it has no effect.
await iminPrinter.printTextBitmap('Bitmap Text',
style: IminTextPictureStyle(
fontSize: 32,
fontStyle: IminFontStyle.bold,
underline: true,
align: IminPrintAlign.center,
),
);Print a table row.
⚠� width is pixel width, not a proportional ratio. 58mm paper = 384px total, 80mm paper = 576px total. Column widths should not exceed paper width.
ColumnMaker properties:
| Property | Type | Default | Description |
|---|---|---|---|
| text | String | '' | Column content |
| width | int | 2 | Column width (pixels) |
| fontSize | int | 26 | Font size |
| align | IminPrintAlign | left | Column alignment |
// 80mm paper example (576px total width)
await iminPrinter.printColumnsText(cols: [
ColumnMaker(text: 'Coffee', width: 250, fontSize: 24, align: IminPrintAlign.left),
ColumnMaker(text: 'x2', width: 100, fontSize: 24, align: IminPrintAlign.center),
ColumnMaker(text: '\$7.00', width: 150, fontSize: 24, align: IminPrintAlign.right),
]);Print a table row (string mode).
⚠� Unlike
printColumnsText, thewidthinprintColumnsStringis a proportional weight (e.g. 1:2:1), not pixel width.
Print text with alignment.
| Param | Type | Description |
|---|---|---|
| text | String | Text content |
| align | int | 0=left 1=center 2=right |
await iminPrinter.printTextWithAli('Centered text', 1);Print text with specified encoding.
| Param | Type | Description |
|---|---|---|
| text | String | Text content |
| encode | String | Encoding name |
await iminPrinter.printTextWithEncode('Text', 'UTF-8');ESC/POS command text printing with font styling support.
⚠� This method temporarily sets ESC/POS font parameters. Call
initPrinterParams()afterwards to reset.
| Param | Type | Required | Description |
|---|---|---|---|
| text | String | � | Text content |
| style | IminEscPosTextStyle | - | ESC/POS text style |
IminEscPosTextStyle properties:
| Property | Type | Description |
|---|---|---|
| widthMultiple | int? | Width multiple 1-8 |
| heightMultiple | int? | Height multiple 1-8 |
| bold | bool? | Bold |
| italic | bool? | Italic |
| antiWhite | bool? | Reverse white |
| underline | int? | Underline 0=none 1=single 2=double |
| lineSpacing | int? | Line spacing |
| charSpace | int? | Character spacing |
| align | IminPrintAlign? | Alignment |
await iminPrinter.printEscPosText('Bold Large Text',
style: IminEscPosTextStyle(
bold: true,
widthMultiple: 2,
heightMultiple: 2,
align: IminPrintAlign.center,
),
);
// Reset
await iminPrinter.initPrinterParams();These are global settings that affect subsequent
printText(without style) calls. CallinitPrinterParams()to reset.
| Param | Type | Description |
|---|---|---|
| size | int | Font size |
await iminPrinter.setTextSize(28);| Param | Type | Description |
|---|---|---|
| typeface | IminTypeface | typefaceDefault / typefaceMonospace / typefaceDefaultBold / typefaceSansSerif / typefaceSerif |
await iminPrinter.setTextTypeface(IminTypeface.typefaceMonospace);| Param | Type | Description |
|---|---|---|
| style | IminFontStyle | normal / bold / italic / boldItalic |
await iminPrinter.setTextStyle(IminFontStyle.bold);| Param | Type | Description |
|---|---|---|
| alignment | IminPrintAlign | left / center / right |
await iminPrinter.setAlignment(IminPrintAlign.center);| Param | Type | Description |
|---|---|---|
| width | int | Text width (pixels). Max 576 for 80mm, 384 for 58mm |
await iminPrinter.setTextWidth(576);| Param | Type | Description |
|---|---|---|
| space | double | Line spacing |
await iminPrinter.setTextLineSpacing(1.0);These are global settings that affect subsequent
printTextBitmapcalls.
await iminPrinter.setTextBitmapTypeface(IminTypeface.typefaceDefaultBold);await iminPrinter.setTextBitmapSize(32);await iminPrinter.setTextBitmapStyle(IminFontStyle.bold);await iminPrinter.setTextBitmapStrikeThru(true);await iminPrinter.setTextBitmapUnderline(true);await iminPrinter.setTextBitmapLineSpacing(1.5);await iminPrinter.setTextBitmapLetterSpacing(2.0);await iminPrinter.setTextBitmapAntiWhite(true);🔴 Global settings warning: These methods only affect
printEscPosTextorprintText(without style). They do NOT affectprintTextBitmap. These are global �you must manually reset after use (e.g.setFontBold(false)) or callinitPrinterParams()to reset all at once.
Set font width/height multiple.
| Param | Type | Description |
|---|---|---|
| wide | int | Width multiple 1-8 |
| high | int | Height multiple 1-8 |
await iminPrinter.setFontMultiple(2, 2);
await iminPrinter.printText('2x Width & Height\n');
await iminPrinter.setFontMultiple(1, 1); // Resetawait iminPrinter.setFontBold(true);
await iminPrinter.printText('Bold Text\n');
await iminPrinter.setFontBold(false); // Resetawait iminPrinter.setFontItalic(true);
await iminPrinter.printText('Italic Text\n');
await iminPrinter.setFontItalic(false);await iminPrinter.setFontAntiWhite(true);
await iminPrinter.printText('Reverse Text\n');
await iminPrinter.setFontAntiWhite(false);| Param | Type | Description |
|---|---|---|
| underline | int | 0=none 1=single 2=double |
await iminPrinter.setFontUnderline(1);
await iminPrinter.printText('Underlined Text\n');
await iminPrinter.setFontUnderline(0);| Param | Type | Description |
|---|---|---|
| rotate | int | 0=0° 1=90° |
| Param | Type | Description |
|---|---|---|
| direction | int | 0=0° 1=180° |
await iminPrinter.setFontLineSpacing(80);await iminPrinter.setFontCharSpace(5);await iminPrinter.setFontChineseSpace(2, 2);await iminPrinter.setFontChineseSize(24, 24, 0, 0);await iminPrinter.setFontCharSize(24, 24, 0, 0);await iminPrinter.setFontChineseMode(0);await iminPrinter.setFontCountryCode(0);- Returns:
Future<List<String>?>
List<String>? codes = await iminPrinter.getFontCountryCode();Print a single image. Supports URL string or Uint8List byte data.
| Param | Type | Required | Description |
|---|---|---|---|
| img | dynamic | � | Image URL or Uint8List |
| pictureStyle | IminPictureStyle | - | Image style |
IminPictureStyle properties:
| Property | Type | Description |
|---|---|---|
| alignment | IminPrintAlign? | Alignment |
| width | int? | Image width (pixels) |
| height | int? | Image height (pixels) |
// URL
await iminPrinter.printSingleBitmap(
'https://example.com/logo.png',
pictureStyle: IminPictureStyle(
alignment: IminPrintAlign.center,
width: 250,
height: 80,
),
);
// Byte data
Uint8List imageBytes = await loadImage();
await iminPrinter.printSingleBitmap(imageBytes,
pictureStyle: IminPictureStyle(alignment: IminPrintAlign.center),
);Print a single image with translation handling. Same parameters as printSingleBitmap.
Print multiple images.
| Param | Type | Required | Description |
|---|---|---|---|
| imgs | List<dynamic> | � | List of image URLs or Uint8List |
| pictureStyle | IminPictureStyle | - | Image style |
await iminPrinter.printMultiBitmap(
['https://example.com/img1.png', 'https://example.com/img2.png'],
pictureStyle: IminPictureStyle(alignment: IminPrintAlign.center, width: 250, height: 80),
);Print a black & white image.
⚠� The
baseStyleparameter is not passed through in the current implementation. Passing it has no effect. Image size is determined by the original image.
await iminPrinter.printSingleBitmapBlackWhite(imageBytes);Print a color chart image. Same parameters as printSingleBitmap.
Print a barcode.
| Param | Type | Required | Description |
|---|---|---|---|
| barCodeType | IminBarcodeType | � | Barcode type |
| barCodeContent | String | � | Barcode content |
| style | IminBarCodeStyle | - | Barcode style |
IminBarcodeType enum:
| Value | Description |
|---|---|
| upcA | UPC-A |
| upcE | UPC-E |
| jan13 | EAN-13 |
| jan8 | EAN-8 |
| code39 | Code 39 |
| itf | ITF |
| codabar | Codabar |
| code93 | Code 93 |
| code128 | Code 128 |
IminBarCodeStyle properties:
| Property | Type | Description |
|---|---|---|
| width | int? | Barcode width 2-6 |
| height | int? | Barcode height 1-255 |
| align | IminPrintAlign? | Alignment |
| position | IminBarcodeTextPos? | HRI position: noText / textAbove / textBelow / both |
await iminPrinter.printBarCode(
IminBarcodeType.code128,
'{C009999789101',
style: IminBarCodeStyle(
width: 3,
height: 100,
align: IminPrintAlign.center,
position: IminBarcodeTextPos.textBelow,
),
);printBarCodeToBitmapFormat(String barCodeContent, int width, int height, IminBarCodeToBitmapFormat codeFormat) [1.0+]
Print barcode in bitmap format.
| Param | Type | Description |
|---|---|---|
| barCodeContent | String | Barcode content |
| width | int | Width |
| height | int | Height |
| codeFormat | IminBarCodeToBitmapFormat | Format: aztec / codabar / code39 / code93 / code128 / dataMatrix / ean13 / itf / maxicode / pdf417 / qrCode / rss14 / rssExpanded / upcA / upcE / upcEanExteNsion |
await iminPrinter.printBarCodeToBitmapFormat('1234567890', 300, 120, IminBarCodeToBitmapFormat.code128);| Param | Type | Description |
|---|---|---|
| width | int | Barcode width 2-6 |
| Param | Type | Description |
|---|---|---|
| height | int | Barcode height 1-255 |
| Param | Type | Description |
|---|---|---|
| position | IminBarcodeTextPos | noText(0) / textAbove(1) / textBelow(2) / both(3) |
Print a QR code.
| Param | Type | Required | Description |
|---|---|---|---|
| data | String | � | QR code content |
| qrCodeStyle | IminQrCodeStyle | - | QR code style |
IminQrCodeStyle properties:
| Property | Type | Description |
|---|---|---|
| qrSize | int? | QR code size |
| align | IminPrintAlign? | Alignment |
| leftMargin | int? | Left margin |
| errorCorrectionLevel | IminQrcodeCorrectionLevel? | Error correction: levelL(48) ~7% / levelM(49) ~15% / levelQ(50) ~25% / levelH(51) ~30% |
await iminPrinter.printQrCode('https://www.imin.sg',
qrCodeStyle: IminQrCodeStyle(
qrSize: 6,
align: IminPrintAlign.center,
errorCorrectionLevel: IminQrcodeCorrectionLevel.levelH,
),
);await iminPrinter.setQrCodeSize(5);await iminPrinter.setQrCodeErrorCorrectionLev(IminQrcodeCorrectionLevel.levelH);Set left margin for QR codes and barcodes.
await iminPrinter.setLeftMargin(5);Set alignment for codes (barcode/QR code).
await iminPrinter.setCodeAlignment(IminPrintAlign.center);printDoubleQR({required IminDoubleQRCodeStyle qrCode1, required IminDoubleQRCodeStyle qrCode2, int? doubleQRSize}) [1.0+]
Print double QR codes side by side.
IminDoubleQRCodeStyle properties:
| Property | Type | Description |
|---|---|---|
| text | String | QR code content |
| level | int? | Error correction level 1-3 |
| leftMargin | int? | Left margin 0-576 |
| version | int? | Version 1-40 |
await iminPrinter.printDoubleQR(
qrCode1: IminDoubleQRCodeStyle(text: 'www.imin.sg'),
qrCode2: IminDoubleQRCodeStyle(text: 'www.google.com'),
doubleQRSize: 5,
);Double QR code size and error correction level settings.
Double QR code left margin settings, range 0-576.
Double QR code version settings, range 1-40.
Generic 2D code printing.
| Param | Type | Description |
|---|---|---|
| data | String | Content |
| symbology | int | Code type |
| moduleSize | int | Module size |
| errorLevel | int | Error correction level |
| align | int | Alignment 0=left 1=center 2=right |
await iminPrinter.print2DCode('https://www.imin.sg', 0, 6, 2, 1);printPDF417(String data, int columns, int rows, int moduleWidth, int rowHeight, int errorLevel, int selectOptions, int align) [2.0]
Print PDF417 code.
| Param | Type | Description |
|---|---|---|
| data | String | Content |
| columns | int | Columns |
| rows | int | Rows |
| moduleWidth | int | Module width |
| rowHeight | int | Row height |
| errorLevel | int | Error correction level |
| selectOptions | int | Options |
| align | int | Alignment 0=left 1=center 2=right |
await iminPrinter.printPDF417('PDF417 Data', 3, 5, 2, 5, 2, 0, 1);printDataMatrix(String data, int symbolType, int columns, int rows, int moduleSize, int align) [2.0]
await iminPrinter.printDataMatrix('DataMatrix Data', 0, 0, 0, 4, 1);printAztecCode(String data, int modeType, int dataLayers, int moduleSize, int errorLevel, int align) [2.0]
await iminPrinter.printAztecCode('Aztec Data', 0, 0, 6, 2, 1);await iminPrinter.printMaxiCode('MaxiCode Data', 4, 1);Feed one line of paper.
await iminPrinter.printAndLineFeed();Feed paper by specified height.
| Param | Type | Description |
|---|---|---|
| height | int | Feed height 1-1016 |
await iminPrinter.printAndFeedPaper(100);Set paper format.
| Param | Type | Description |
|---|---|---|
| style | int? | 0=80mm 1=58mm |
await iminPrinter.setPageFormat(style: 0); // 80mmPartial paper cut. Only for devices with cutter hardware.
await iminPrinter.partialCut();Full paper cut. Only for devices with cutter hardware.
await iminPrinter.fullCut();Print and retract paper.
| Param | Type | Description |
|---|---|---|
| value | int | Retract distance |
await iminPrinter.printAndQuitPaper(100);Partial cut and feed paper.
| Param | Type | Description |
|---|---|---|
| length | int | Feed length |
await iminPrinter.partialCutAndFeedPaper(50);Full cut and feed paper.
| Param | Type | Description |
|---|---|---|
| length | int | Feed length |
await iminPrinter.fullCutAndFeedPaper(50);Transaction printing lets you cache multiple print commands and submit them at once for better efficiency and consistency.
try {
// 1. Enter buffer mode
await iminPrinter.enterPrinterBuffer(true);
// 2. Add print commands
await iminPrinter.printText('Line 1');
await iminPrinter.printText('Line 2');
await iminPrinter.printText('Line 3');
// 3. Commit and print
await iminPrinter.commitPrinterBuffer();
// 4. Exit buffer
await iminPrinter.exitPrinterBuffer(true);
} catch (e) {
// Discard buffer on error
await iminPrinter.exitPrinterBuffer(false);
}| Param | Type | Description |
|---|---|---|
| isClean | bool | Whether to clear previous buffer |
Commit buffer and execute printing.
| Param | Type | Description |
|---|---|---|
| isCommit | bool | true=commit then exit, false=discard then exit |
Commit buffer with callback.
- Returns:
Future<bool?>
bool? ok = await iminPrinter.commitPrinterBufferWithCallback();Exit buffer with callback.
- Returns:
Future<bool?>
bool? ok = await iminPrinter.exitPrinterBufferWithCallback(true);Label printing uses a canvas workflow: initialize canvas �add elements (text/barcode/QR/image/shape) �print canvas.
Initialize label canvas.
LabelCanvasStyle properties:
| Property | Type | Default | Description |
|---|---|---|---|
| width | int? | 50 | Canvas width |
| height | int? | 50 | Canvas height |
| posX | int? | 0 | X offset |
| posY | int? | 0 | Y offset |
| enableReverse | bool? | false | Reverse |
| enableMirror | bool? | false | Mirror |
await iminPrinter.labelInitCanvas(
labelCanvasStyle: LabelCanvasStyle(width: 400, height: 240, posX: 0, posY: 0),
);Add text to label.
LabelTextStyle properties:
| Property | Type | Default | Description |
|---|---|---|---|
| posX | int? | 0 | X position |
| posY | int? | 0 | Y position |
| textSize | int? | 24 | Font size |
| textWidthRatio | int? | 1 | Width ratio |
| textHeightRatio | int? | 1 | Height ratio |
| width | int? | -1 | Text area width (-1=auto) |
| height | int? | -1 | Text area height (-1=auto) |
| align | AlignLabel? | DEFAULT | Alignment: DEFAULT / LEFT / CENTER / RIGHT |
| rotate | Rotate? | ROTATE_0 | Rotation: ROTATE_0 / ROTATE_90 / ROTATE_180 / ROTATE_270 |
| textSpace | int? | 0 | Character spacing |
| enableBold | bool? | false | Bold |
| enableUnderline | bool? | false | Underline |
| enableStrikethrough | bool? | false | Strikethrough |
| enableItalics | bool? | false | Italic |
| enAntiColor | bool? | false | Reverse color |
await iminPrinter.labelAddText('Product Name',
labelTextStyle: LabelTextStyle(posX: 20, posY: 20, textSize: 28, enableBold: true),
);Add barcode to label.
LabelBarCodeStyle properties:
| Property | Type | Default | Description |
|---|---|---|---|
| posX | int? | 0 | X position |
| posY | int? | 0 | Y position |
| dotWidth | int? | 2 | Dot width |
| barHeight | int? | 162 | Bar height |
| readable | HumanReadable? | HIDE | HRI text: HIDE / POS_ONE / POS_TWO / POS_THREE |
| symbology | Symbology? | CODE39 | Symbology: UPCA / UPCE / EAN13 / EAN8 / CODE39 / ITF / CODABAR / CODE93 / CODE128 |
| align | AlignLabel? | DEFAULT | Alignment |
| rotate | Rotate? | ROTATE_0 | Rotation |
| width | int? | -1 | Barcode area width (-1=auto) |
| height | int? | -1 | Barcode area height (-1=auto) |
await iminPrinter.labelAddBarCode('{B123456',
barCodeStyle: LabelBarCodeStyle(
posX: 20, posY: 100,
symbology: Symbology.CODE128,
barHeight: 60,
readable: HumanReadable.POS_TWO,
),
);Add QR code to label.
LabelQrCodeStyle properties:
| Property | Type | Default | Description |
|---|---|---|---|
| posX | int? | 0 | X position |
| posY | int? | 0 | Y position |
| size | int? | 4 | QR code size |
| errorLevel | ErrorLevel? | L | Error correction: L / M / Q / H |
| rotate | Rotate? | ROTATE_0 | Rotation |
| width | int? | -1 | QR code area width (-1=auto) |
| height | int? | -1 | QR code area height (-1=auto) |
await iminPrinter.labelAddQrCode('https://www.imin.sg',
qrCodeStyle: LabelQrCodeStyle(posX: 280, posY: 50, size: 6, errorLevel: ErrorLevel.M),
);Add shape/area to label.
LabelAreaStyle properties:
| Property | Type | Default | Description |
|---|---|---|---|
| style | Shape | RECT_FILL | Shape: RECT_FILL / RECT_WHITE / RECT_REVERSE / BOX / CIRCLE / OVAL / PATH |
| posX | int? | 0 | Start X |
| posY | int? | 0 | Start Y |
| endX | int? | 50 | End X (PATH mode) |
| endY | int? | 50 | End Y (PATH mode) |
| width | int? | 50 | Width |
| height | int? | 50 | Height |
| thick | int? | 1 | Line thickness |
await iminPrinter.labelAddArea(
areaStyle: LabelAreaStyle(style: Shape.BOX, posX: 10, posY: 10, width: 380, height: 220, thick: 2),
);Add image to label.
LabelBitmapStyle properties:
| Property | Type | Default | Description |
|---|---|---|---|
| posX | int? | 0 | X position |
| posY | int? | 0 | Y position |
| algorithm | ImageAlgorithm? | BINARIZATION | Algorithm: BINARIZATION / DITHERING |
| value | int? | 200 | Threshold |
| width | int? | -1 | Width (-1=auto) |
| height | int? | -1 | Height (-1=auto) |
Print the label canvas.
| Param | Type | Description |
|---|---|---|
| printCount | int | Number of copies |
await iminPrinter.labelPrintCanvas(1);Print label bitmap.
LabelPrintBitmapStyle properties:
| Property | Type | Description |
|---|---|---|
| width | int? | Width |
| height | int? | Height |
Label learning (auto-detect label gap).
await iminPrinter.labelLearning();Set print mode.
| Param | Type | Description |
|---|---|---|
| printModel | int | 0=thermal 1=label |
await iminPrinter.setPrintModel(1); // Switch to label modeDirect label bitmap printing.
| Param | Type | Description |
|---|---|---|
| bitmap | Uint8List | Bitmap data |
| width | int | Width |
| height | int | Height |
Gap sensor calibration.
- Returns:
Future<String?>
String? result = await iminPrinter.labelGapSensorCalibration();Set label printer mode.
| Param | Type | Description |
|---|---|---|
| mode | int | Mode value |
Query label information.
- Returns:
Future<String?>
IminLabelInfo enum:
| Value | Description |
|---|---|
| MODEL | Model |
| VERSION | Version |
| HEIGHT | Height |
| DENSITY | Density |
| SPEED | Speed |
| MODE | Mode |
| GAP_OFFSET | Gap offset |
| PRINT_LENGTH | Print length |
| NO_PAPER_THRESHOLD | No paper threshold |
| HAS_PAPER_THRESHOLD | Has paper threshold |
| THRESHOLD_ADJUSTMENT | Threshold adjustment |
| ORIGINAL_STATUS | Original status |
| LABEL_STATUS | Label status |
| PAPER_STATUS | Paper status |
| HOST_RESULT | Host result |
| GAP_ERROR | Gap error |
String? model = await iminPrinter.labelQueryInfo(IminLabelInfo.MODEL);
String? version = await iminPrinter.labelQueryInfo(IminLabelInfo.VERSION);Restore label defaults.
- Returns:
Future<bool?>
bool? ok = await iminPrinter.labelRestoreDefaults();Set continuous label printing.
| Param | Type | Description |
|---|---|---|
| enable | bool | true=enable false=disable |
await iminPrinter.setLabelContinuousPrint(true);Future<void> printProductLabel() async {
// Initialize canvas (50mm x 30mm, multiply by 8 for pixels)
await iminPrinter.labelInitCanvas(
labelCanvasStyle: LabelCanvasStyle(width: 400, height: 240, posX: 48),
);
// Add title
await iminPrinter.labelAddText('Fuji Apple',
labelTextStyle: LabelTextStyle(posX: 20, posY: 20, textSize: 28, enableBold: true),
);
// Add price
await iminPrinter.labelAddText('\$16.98',
labelTextStyle: LabelTextStyle(posX: 20, posY: 60, textSize: 40, enableBold: true),
);
// Add barcode
await iminPrinter.labelAddBarCode('{B123456',
barCodeStyle: LabelBarCodeStyle(
posX: 20, posY: 120,
symbology: Symbology.CODE128,
dotWidth: 2, barHeight: 50,
readable: HumanReadable.POS_TWO,
),
);
// Add border
await iminPrinter.labelAddArea(
areaStyle: LabelAreaStyle(style: Shape.BOX, posX: 5, posY: 5, width: 390, height: 230, thick: 2),
);
// Print 1 copy
await iminPrinter.labelPrintCanvas(1);
}Open cash drawer.
await iminPrinter.openCashBox();Get cash drawer status.
- Returns:
Future<bool?>
bool? isOpen = await iminPrinter.getDrawerStatus();Get cash drawer open count.
- Returns:
Future<int?>
int? times = await iminPrinter.getOpenDrawerTimes();Check if device supports cash drawer.
- Returns:
Future<bool?>
bool? supported = await iminPrinter.supportCashBox();All methods below return Future<String?> or Future<int?> with no parameters.
String? serialNumber = await iminPrinter.getPrinterSerialNumber();
String? modelName = await iminPrinter.getPrinterModelName();
String? thermalHead = await iminPrinter.getPrinterThermalHead();
String? firmwareVersion = await iminPrinter.getPrinterFirmwareVersion();
String? hardwareVersion = await iminPrinter.getPrinterHardwareVersion();
String? serviceVersion = await iminPrinter.getServiceVersion();
String? usbVidPid = await iminPrinter.getUsbPrinterVidPid();
String? usbName = await iminPrinter.getUsbDevicesName();
int? density = await iminPrinter.getPrinterDensity();
String? paperDistance = await iminPrinter.getPrinterPaperDistance();
int? paperType = await iminPrinter.getPrinterPaperType();
String? cutTimes = await iminPrinter.getPrinterCutTimes();
int? mode = await iminPrinter.getPrinterMode();
// 2.0 only
String? temperature = await iminPrinter.getPrinterTemperature();
String? supplierName = await iminPrinter.getPrinterSupplierName();
List<String>? patternList = await iminPrinter.getPrinterPatternList();
String? knifeReset = await iminPrinter.getPrinterKnifeReset();// Density
List<String>? densityList = await iminPrinter.getPrinterDensityList();
// Speed
List<String>? speedList = await iminPrinter.getPrinterSpeedList();
await iminPrinter.setPrinterSpeed(3);
int? speed = await iminPrinter.getPrinterSpeed();
// Paper type
List<String>? paperTypes = await iminPrinter.getPrinterPaperTypeList();
// Codepage
List<String>? codepages = await iminPrinter.getFontCodepage();
await iminPrinter.setFontCodepage(0);
String? curCodepage = await iminPrinter.getCurCodepage();
// Encoding
List<String>? encodeList = await iminPrinter.getEncodeList();
String? curEncode = await iminPrinter.getCurEncode();
await iminPrinter.setPrinterEncode(0);
// Default printer
await iminPrinter.setInitIminPrinter(true);Generic printer setting and query interface for accessing advanced features.
- Returns:
Future<bool?>
bool? ok = await iminPrinter.setPrinterAction('key', 'value');- Returns:
Future<bool?>
- Returns:
Future<String?>
- Returns:
Future<List<String>?>
- Returns:
Future<String?>
Send raw ESC/POS byte data.
await iminPrinter.sendRAWData(Uint8List.fromList([0x1B, 0x40])); // ESC @ initializeSend hex string.
await iminPrinter.sendRAWDataHexStr('0A'); // Line feedRegister printer status change callback. After registration, listen via receiveBroadcastStream.
await iminPrinter.regesiterPrinterStatusCallback();
iminPrinter.receiveBroadcastStream.listen((status) {
print('Printer status changed: $status');
});