It is used to print text, pictures, two-dimensional code, bar code and other functions sdk in imin printer using Android system
| Android |
|---|
| β |
Official Imin Inner Printer Doc
This plugin supports two SDK versions based on your Android OS version:
| SDK Version | Android Version | Status | Features |
|---|---|---|---|
| SDK 2.0 | Android 13+ | β Recommended | Full feature set including label printing, text bitmap, buffer management |
| SDK 1.0 | Android 11 and below | π Legacy | Basic printing, images, barcodes, QR codes |
Important: Choose the appropriate SDK version based on your target device's Android OS version. SDK 2.0 provides enhanced features and is recommended for all new projects on compatible devices.
- π API Documentation - Complete API reference
- π Quick Start Guide - Get started quickly
- π‘ Practical Examples - Real-world usage examples
- π§ Device Compatibility - Supported devices and features
- π Migration Guide - Upgrade from older versions
flutter pub add imin_printerimport 'package:imin_printer/imin_printer.dart';
import 'package:imin_printer/enums.dart';
import 'package:imin_printer/imin_style.dart';
// Initialize printer
final iminPrinter = IminPrinter();
await iminPrinter.initPrinter();
// Check printer status
Map<String, dynamic> status = await iminPrinter.getPrinterStatus();
print('Printer status: ${status['msg']}');
// Print text
await iminPrinter.printText(
'Hello World',
style: IminTextStyle(
fontSize: 28,
fontStyle: IminFontStyle.bold,
align: IminPrintAlign.center,
)
);
// Print QR code
await iminPrinter.printQrCode(
'https://www.imin.sg',
qrCodeStyle: IminQrCodeStyle(
qrSize: 6,
align: IminPrintAlign.center,
)
);
// Cut paper (if device supports cutter)
await iminPrinter.partialCut();This SDK supports all iMin devices with built-in thermal printers, including:
- Handheld Finance Series: Compact portable devices with 58mm paper width
- Flat Panel Terminal Series: Tablet-style terminals supporting 58mm and 80mm paper widths
- Desktop Cash Register Equipment: Desktop POS terminals with 80mm paper width
- Paper Width: 58mm or 80mm depending on device model
- Cutter Support: Available on select models with cutter hardware
- Android Compatibility:
- SDK 2.0 for Android 13+
- SDK 1.0 for Android 11 and below
For complete device compatibility information and feature support matrix, see Device Compatibility Guide.
- β Text printing with custom styles
- β Image printing (URL and byte array)
- β Table/column printing
- β Anti-white text printing
- β Multiple barcode formats (UPC, EAN, Code128, etc.)
- β QR code with error correction levels
- β Double QR code printing
- β Custom positioning and sizing
- β Canvas-based label design
- β Text, barcode, QR code on labels
- β Image and shape elements
- β Flexible positioning
- β Text bitmap rendering
- β Print buffer management
- β Printer configuration
- β Cash drawer control
- β Paper cutting (on devices with cutter hardware)
Future<void> printReceipt() async {
await iminPrinter.initPrinter();
// Header
await iminPrinter.printText(
'STORE RECEIPT',
style: IminTextStyle(
fontSize: 32,
fontStyle: IminFontStyle.bold,
align: IminPrintAlign.center,
),
);
// Items
await iminPrinter.printColumnsText(cols: [
ColumnMaker(text: 'Coffee', width: 2, align: IminPrintAlign.left),
ColumnMaker(text: '\$3.50', width: 1, align: IminPrintAlign.right),
]);
// QR Code
await iminPrinter.printQrCode('receipt-12345');
await iminPrinter.partialCut();
}Future<void> printProductLabel() async {
// Initialize label canvas
await iminPrinter.labelInitCanvas(
labelCanvasStyle: LabelCanvasStyle(width: 400, height: 300),
);
// Add product name
await iminPrinter.labelAddText('Product Name');
// Add barcode
await iminPrinter.labelAddBarCode('1234567890');
// Print label
await iminPrinter.labelPrintCanvas(1);
}For more examples, see Practical Examples.
// Initialize printer
await iminPrinter.initPrinter();
// Check status
Map<String, dynamic> status = await iminPrinter.getPrinterStatus();
// Print text with styling
await iminPrinter.printText(
'Styled Text',
style: IminTextStyle(
fontSize: 24,
fontStyle: IminFontStyle.bold,
align: IminPrintAlign.center,
),
);enum IminPrintAlign {
left,
center,
right
}enum IminQrcodeCorrectionLevel {
levelL(48), // ~7% correction
levelM(49), // ~15% correction
levelQ(50), // ~25% correction
levelH(51); // ~30% correction
}enum IminFontStyle {
normal,
bold,
italic,
boldItalic
}
enum IminTypeface {
typefaceDefault,
typefaceMonospace,
typefaceDefaultBold,
typefaceSansSerif,
typefaceSerif
}class IminTextStyle {
bool? wordWrap; // Auto line wrap
int? fontSize; // Font size
double? space; // Line spacing
IminTypeface? typeface; // Font family
IminFontStyle? fontStyle; // Bold, italic, etc.
IminPrintAlign? align; // Text alignment
}For complete API documentation, see API Documentation.
Always wrap printer operations in try-catch blocks:
Future<void> safePrint() async {
try {
// Check printer status first
Map<String, dynamic> status = await iminPrinter.getPrinterStatus();
if (status['code'] != '0') {
throw Exception('Printer not ready: ${status['msg']}');
}
await iminPrinter.printText('Hello World');
} catch (e) {
print('Print error: $e');
// Handle error appropriately
}
}If you're upgrading from an older version:
- Add await keywords to all printer method calls
- Update parameter names (e.g.,
style:parameter) - Handle Future return types properly
- Check the migration guide for detailed instructions
See Migration Guide for complete upgrade instructions.
- π Documentation
- π GitHub Issues
- π§ Official iMin Documentation
Contributions are welcome! Please read our contributing guidelines and submit pull requests to help improve this plugin.
This project is licensed under the terms specified in the LICENSE file.