Quick Print는 Android, iOS, macOS, Windows, Linux 등 여러 플랫폼에서 원활한 PDF 인쇄를 위한 유연한 Flutter 패키지입니다. ESC/POS, Sunmi, 블루투스, USB 및 시스템 프린터와 같은 다양한 프린터를 지원하여 개발자가 효율적으로 인쇄 작업을 생성하고 전송할 수 있도록 합니다. 일관된 API와 강력한 장치 호환성을 통해 크로스플랫폼 인쇄를 간소화합니다. 소매, POS 및 문서 관리 애플리케이션에 적합하며 신뢰할 수 있는 인쇄 기능이 필요한 경우에 이상적입니다.
사용 사례
소매 영수증 인쇄
POS 시스템 통합
문서 일괄 인쇄
모바일 앱 보고서
크로스 플랫폼 인쇄
주요 기능
다중 플랫폼 지원
ESC/POS 및 블루투스 프린터 호환성
PDF 생성 및 인쇄
USB 및 시스템 프린터 통합
다기기 인쇄 작업 처리
적합한 대상
POS 애플리케이션 개발자
소매 소프트웨어 팀
인쇄가 필요한 모바일 앱 개발자
문서 자동화 프로젝트
크로스 플랫폼 인쇄 솔루션
고려 사항
플랫폼별 설정이 필요합니다
고급 기능에 대한 문서가 제한되어 있음
블루투스 연결은 사용자 개입이 필요할 수 있습니다
대상 OS에서 프린터 드라이버 사용 가능 여부
여러 기기에서 테스트하는 것이 권장됩니다
원본 README
연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
Quick Print
A comprehensive Flutter package for handling PDF printing across different platforms and devices. This package provides a unified interface for printing PDFs using various printer types, including ESC/POS, Sunmi, Bluetooth, USB, and system printers.
Features
🖨️ Multi-printer Support
Sunmi printer support for Android devices
Bluetooth printer integration (including BLE)
USB printer compatibility
Desktop system printer support
Mobile device printing
🖼️ Image Printing Support
Print images (Uint8List) directly to any supported printer
📄 Paper Size Options
80mm paper width (POS printers)
58mm paper width (Thermal printers)
A4 paper size
🎯 Platform Support
Android
iOS
Windows
Linux
macOS
🔍 Printer Discovery
Discover Bluetooth, BLE, USB, and desktop printers
Unified API for managing discovered printers
🛠️ Error Handling
Custom exceptions for invalid files, unconnected devices, and unsupported operations
Getting Started
Add this to your package's pubspec.yaml file:
dependencies:quick_print:<LASTEST_VERSION>
Then run:
flutter pub get
Usage
Basic Usage
import'package:quick_print/quick_print.dart';
// Create a printer instancefinal printer = QuickPrint(PrinterDeviceType.mobile);
// Print a PDF fileawait printer.instance.print(
path: 'assets/document.pdf',
paperSize: PaperSize.a4,
);
// Print an image (as Uint8List)final imageBytes = awaitFile('assets/image.png').readAsBytes();
await printer.instance.printImage(
bytes: imageBytes,
paperSize: PaperSize.a4,
);
Printer Discovery
The PrinterDiscoveryService class allows you to discover printers on various platforms.
import'package:quick_print/quick_print.dart';
final discoveryService = PrinterDiscoveryService();
// Initialize the service (required for BLE on Windows)await discoveryService.initialize();
// Discover printersawait discoveryService.discoverDevices();
// List discovered printersfinal printers = discoveryService.printerDevicesList;
printers.forEach((printer) {
print('Discovered printer: ${printer.name}');
});
// Dispose of the service when done
discoveryService.dispose();
Bluetooth Printer
import'package:quick_print/quick_print.dart';
// Create a Bluetooth printer modelfinal bluetoothModel = BluetoothPrinterModel(
name: 'Thermal Printer',
address: '00:11:22:33:44:55',
isBle: false,
);
// Create a printer instancefinal printer = QuickPrint(PrinterDeviceType.bluetooth);
// Print with the Bluetooth printerawait printer.instance.print(
path: 'assets/receipt.pdf',
paperSize: PaperSize.mm80,
model: bluetoothModel,
);
USB Printer
import'package:quick_print/quick_print.dart';
// Create a USB printer modelfinal usbModel = UsbPrinterModel(
name: 'POS-58',
productId: '0x0483',
vendorId: '0x5740',
);
// Create a printer instancefinal printer = QuickPrint(PrinterDeviceType.usb);
// Print with the USB printerawait printer.instance.print(
path: 'assets/receipt.pdf',
paperSize: PaperSize.mm58,
model: usbModel,
);
Platform-specific Setup
Android
Add the following permissions to your AndroidManifest.xml:
<!-- For Bluetooth printers --><uses-permissionandroid:name="android.permission.BLUETOOTH"/><uses-permissionandroid:name="android.permission.BLUETOOTH_ADMIN"/><uses-permissionandroid:name="android.permission.BLUETOOTH_CONNECT"/><uses-permissionandroid:name="android.permission.BLUETOOTH_SCAN"/><!-- For USB printers --><uses-featureandroid:name="android.hardware.usb.host"/>
iOS
Add the following to your Info.plist:
<key>UISupportedExternalAccessoryProtocols</key><array><string>com.printer.protocol</string></array><!-- For Bluetooth printers --><key>NSBluetoothAlwaysUsageDescription</key><string>Need BT access for printing</string><key>NSBluetoothPeripheralUsageDescription</key><string>Need BT access for printing</string>