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

パッケージ詳細v1.0.3

flutter_esc_pos_network

このライブラリは、熱敏Wi-Fi / イーサネットプリンタを使用してESC / POSコマンドでレシートを印刷できます。

AndroidiOSmacOSWindowsLinux
30日間ダウンロード
2770
いいね数
30
Pub ポイント
130

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

flutter pub add flutter_esc_pos_network

パッケージ概要

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

Wi-Fi またはイーサネット経由で接続された熱転写プリンタに ESC/POS コマンドを使用してレシート印刷を可能にするFlutterパッケージです。標準のESC/POSプロトコルを使用してネットワークプリンタとの通信を実現し、販売端末システムや小売アプリケーションに最適です。このライブラリはAndroid、iOS、macOS、Windows、Linuxなど複数のプラットフォームをサポートしており、クロスプラットフォーム互換性を確保しています。開発者はFlutterアプリから直接フォーマット済みテキスト、バーコード、画像をプリンタに送信できます。

用途

  • 販売時点システム
  • 小売レシート印刷
  • レストラン注文印刷
  • 在庫管理
  • イベントチケットの印刷

主な機能

  • Wi-Fi およびイーサネットプリンター対応
  • ESC/POS コマンド互換性
  • クロスプラットフォーム機能
  • テキスト、バーコード、および画像印刷
  • Flutterアプリとのシンプルな統合

適している対象

  • 小売開発者
  • POSアプリケーション作成者
  • 印刷が必要なモバイルアプリ開発者
  • ネットワーク接続された熱転写プリンターを持つ企業
  • IoT対応キオスクソリューション

注意事項

  • 互換性のあるESC/POSプリンタが必要です
  • ネットワーク構成が必要です
  • プリンターのIPアドレスは既知でなければなりません
  • ネットワーク接続デバイスに限定
  • 組み込みのプリンタ検出機能なし

元の README

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

flutter_esc_pos_network

The library allows to print receipts using an ESC/POS thermal WiFi/Ethernet printer. For Bluetooth printers, use esc_pos_bluetooth library.

It can be used in Flutter or pure Dart projects. For Flutter projects, both Android, iOS, windows, Linux and MacOS are supported.

To scan for printers in your network, consider using ping_discover_network package. Note that most of the ESC/POS printers by default listen on port 9100.

TODO (PRs are welcomed!)

  • Print QR Codes using the GS ( k command (printing QR code from an image already supported)
  • PDF-417 Barcodes using the GS ( k command
  • Line spacing using the ESC 3 <n> command

How to Help

  • Test your printer and add it in the table: Wifi/Network printer or Bluetooth printer
  • Test and report bugs
  • Share your ideas about what could be improved (code optimization, new features...)
  • PRs are welcomed!

Tested Printers

Here are some printers tested with this library. Please add the models you have tested to maintain and improve this library and help others to choose the right printer.

Generate a Receipt

Simple Receipt with Styles:
void testReceipt(NetworkPrinter printer) {
  printer.text(
        'Regular: aA bB cC dD eE fF gG hH iI jJ kK lL mM nN oO pP qQ rR sS tT uU vV wW xX yY zZ');
  printer.text('Special 1: àÀ èÈ éÉ ûÛ üÜ çÇ ôÔ',
      styles: PosStyles(codeTable: 'CP1252'));
  printer.text('Special 2: blåbærgrød',
      styles: PosStyles(codeTable: 'CP1252'));

  printer.text('Bold text', styles: PosStyles(bold: true));
  printer.text('Reverse text', styles: PosStyles(reverse: true));
  printer.text('Underlined text',
      styles: PosStyles(underline: true), linesAfter: 1);
  printer.text('Align left', styles: PosStyles(align: PosAlign.left));
  printer.text('Align center', styles: PosStyles(align: PosAlign.center));
  printer.text('Align right',
      styles: PosStyles(align: PosAlign.right), linesAfter: 1);

  printer.text('Text size 200%',
      styles: PosStyles(
        height: PosTextSize.size2,
        width: PosTextSize.size2,
      ));

  printer.feed(2);
  printer.cut();
}

You can find more examples here: flutter_esc_pos_utils.

Print a Receipt

import 'package:flutter_esc_pos_network/flutter_esc_pos_network.dart';
final printer = PrinterNetworkManager('192.168.1.100');
    PosPrintResult connect = await printer.connect();
    if (connect == PosPrintResult.success) {
      PosPrintResult printing = await printer.printTicket(ticket);

      print(printing.msg);
      printer.disconnect();
    }
  }

For a complete example, check example/example.dart

カテゴリー

依存関係

依存関係一覧 1 件

ソースリポジトリ

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

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