パッケージ、リポジトリ、アプリカテゴリを検索

fp_bt_printer のカバー
パッケージ詳細v0.0.3

fp_bt_printer

Bluetooth熱転写プリンターでレシートを印刷する(Androidのみ)。

Android
30日間ダウンロード
35
いいね数
23
Pub ポイント
125

パッケージをインストール

flutter pub add fp_bt_printer

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

Androidデバイス専用に設計された、Bluetooth熱転写プリンタでレシートを印刷するためのFlutterパッケージです。モバイルアプリから直接印刷コマンドを送信できる、互換性のあるBluetoothプリンタとのスムーズな通信を可能にします。販売端末システム、小売キオスク、移動中のレシート印刷が必要な中小企業向けに最適です。ペアリング、接続管理、データ送信を効率的に処理します。ネイティブAndroid Bluetooth APIに依存しており、iOSや他のプラットフォームはサポートしていません。

用途

  • 販売時点システム
  • 小売レシート印刷
  • モバイルキオスクアプリケーション
  • イベントチケットの印刷
  • 現場での注文処理

主な機能

  • Bluetooth熱敏プリンタの統合
  • Android専用のサポート
  • 領収書テキストおよび画像印刷
  • 自動プリンタ検出
  • 印刷コマンド用のシンプルなAPI

適している対象

  • Android開発者
  • 小売アプリ作成者
  • POSシステム統合業者
  • 中小企業向けソフトウェア
  • モバイル印刷ソリューション

注意事項

  • Androidデバイスが必要
  • Bluetooth熱転写プリンタに限定
  • iOS 対応なし
  • AndroidManifest.xml に適切な権限が必要です
  • プリンタの互換性を確認する必要があります

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

fp_bt_printer

This library allows printing receipts on bluetooth thermal printers (android only). Support 58mm and 80mm printer.

It allows to print QR, BarCode, Images RasterImages with the esc_pos_utils package.

List bounded devices

Get list of bluetooth devices, it supports any version of bluetooth, not just BLE.

    List<PrinterDevice> devices = [];
    FpBtPrinter printer = FpBtPrinter();

    Future<void> getDevices() async {
        final response = await printer.scanBondedDevices();
        setState(() {
        devices = response;
        });
    }
Check device connected

You can check that the connection with the device is correct.

    Future<void> setConnet(PrinterDevice d) async {
        final response = await printer.checkConnection(d.address);
        print(response.message);
    }
Print data

This method recibe address of the printer and List of the data;

    FpBtPrinter printer = FpBtPrinter();
    final resp = await printer.printData(bytes, address: address);
    if (resp.success) {
     //print ok
    } else {
    print(resp.message); //print error
    }
Ticket with Styles usin :
List<int> getTicket() {
  final List<int> bytes = [];
  // Using default profile
  final profile = await CapabilityProfile.load();
    final generator = Generator(PaperSize.mm80, profile);
    List<int> bytes = [];

    // //  Print image:
    final ByteData data = await rootBundle.load('assets/wz.png');
    final Uint8List bytesImg = data.buffer.asUint8List();
    var image = decodePng(bytesImg);

    // resize
    var thumbnail =
        copyResize(image!, interpolation: Interpolation.nearest, height: 200);

    bytes += generator.text("fp_bt_printer",
        styles: PosStyles(align: PosAlign.center, bold: true));

    bytes += generator.imageRaster(thumbnail, align: PosAlign.center);

    bytes += generator.reset();
    bytes += generator.setGlobalCodeTable('CP1252');
    bytes += generator.feed(1);
    bytes += generator.text("HELLO PRINTER by FPV",
        styles: PosStyles(align: PosAlign.center, bold: true));
    bytes += generator.qrcode("https://github.com/FranciscoPV94",
        size: QRSize.Size6);
    bytes += generator.feed(1);
    bytes += generator.feed(1);

    final resp = await printer.printData(bytes, address: address);
  return bytes;
}

Tested and working with following Bluetooth Thermal Printers:

Xprinter Portable Thermal Printer

Model: Bixolon SPP-R310

Evidence

test receipt

Support me

If you think that this project has helped you with your developments, you can support this project, any support is much appreciated. Paypal

カテゴリー

依存関係

依存関係一覧 1 件

ソースリポジトリ

このパッケージを使用しているプロジェクト

データはまだありません。