{"id":26158226,"url":"https://github.com/andrey-ushakov/esc_pos_bluetooth","last_synced_at":"2025-04-09T05:08:22.583Z","repository":{"id":41111559,"uuid":"246353349","full_name":"andrey-ushakov/esc_pos_bluetooth","owner":"andrey-ushakov","description":"ESC/POS (thermal, receipt) printing for Flutter \u0026 Dart (Android/iOS)","archived":false,"fork":false,"pushed_at":"2024-04-08T11:59:08.000Z","size":104,"stargazers_count":252,"open_issues_count":112,"forks_count":350,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-04-02T04:02:32.399Z","etag":null,"topics":["bluetooth-printer","dart","esc","flutter","pos","receipt","receipt-printer","thermal-printer"],"latest_commit_sha":null,"homepage":null,"language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andrey-ushakov.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-10T16:33:52.000Z","updated_at":"2025-02-16T23:31:54.000Z","dependencies_parsed_at":"2024-06-18T23:00:19.058Z","dependency_job_id":"5cce0b62-ffb0-4113-a67d-055b88707dcf","html_url":"https://github.com/andrey-ushakov/esc_pos_bluetooth","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrey-ushakov%2Fesc_pos_bluetooth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrey-ushakov%2Fesc_pos_bluetooth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrey-ushakov%2Fesc_pos_bluetooth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrey-ushakov%2Fesc_pos_bluetooth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andrey-ushakov","download_url":"https://codeload.github.com/andrey-ushakov/esc_pos_bluetooth/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247980837,"owners_count":21027808,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bluetooth-printer","dart","esc","flutter","pos","receipt","receipt-printer","thermal-printer"],"created_at":"2025-03-11T10:41:01.468Z","updated_at":"2025-04-09T05:08:22.565Z","avatar_url":"https://github.com/andrey-ushakov.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# esc_pos_bluetooth\n\n[![Pub Version](https://img.shields.io/pub/v/esc_pos_bluetooth)](https://pub.dev/packages/esc_pos_bluetooth)\n\nThe library allows to print receipts using a Bluetooth printer. For WiFi/Ethernet printers, use [esc_pos_printer](https://github.com/andrey-ushakov/esc_pos_printer) library.\n\n\n## TODO (PRs are welcomed!)\n* Split byte data into chunks: [issue](https://github.com/andrey-ushakov/esc_pos_bluetooth/issues/5)\n* Print QR Codes using the `GS ( k` command (printing QR code from an image already supported)\n* PDF-417 Barcodes using the `GS ( k` command\n* Line spacing using the `ESC 3 \u003cn\u003e` command\n\n## How to Help\n* Test your printer and add it in the table: [Wifi/Network printer](https://github.com/andrey-ushakov/esc_pos_printer/blob/master/printers.md) or [Bluetooth printer](https://github.com/andrey-ushakov/esc_pos_bluetooth/blob/master/printers.md)\n* Test and report bugs\n* Share your ideas about what could be improved (code optimization, new features...)\n* PRs are welcomed!\n\n\n## Tested Printers\nHere are some [printers tested with this library](printers.md). Please add the models you have tested to maintain and improve this library and help others to choose the right printer.\n\n\n## Generate a Ticket\n\n### Simple Ticket with Styles:\n```dart\nTicket testTicket() {\n  final Ticket ticket = Ticket(PaperSize.mm80);\n\n  ticket.text(\n      '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');\n  ticket.text('Special 1: àÀ èÈ éÉ ûÛ üÜ çÇ ôÔ',\n      styles: PosStyles(codeTable: PosCodeTable.westEur));\n  ticket.text('Special 2: blåbærgrød',\n      styles: PosStyles(codeTable: PosCodeTable.westEur));\n\n  ticket.text('Bold text', styles: PosStyles(bold: true));\n  ticket.text('Reverse text', styles: PosStyles(reverse: true));\n  ticket.text('Underlined text',\n      styles: PosStyles(underline: true), linesAfter: 1);\n  ticket.text('Align left', styles: PosStyles(align: PosAlign.left));\n  ticket.text('Align center', styles: PosStyles(align: PosAlign.center));\n  ticket.text('Align right',\n      styles: PosStyles(align: PosAlign.right), linesAfter: 1);\n\n  ticket.text('Text size 200%',\n      styles: PosStyles(\n        height: PosTextSize.size2,\n        width: PosTextSize.size2,\n      ));\n\n  ticket.feed(2);\n  ticket.cut();\n  return ticket;\n}\n```\n\nYou can find more examples here: [esc_pos_utils](https://github.com/andrey-ushakov/esc_pos_utils).\n\n\n## Print a Ticket\n\n```dart\nPrinterBluetoothManager printerManager = PrinterBluetoothManager();\n\nprinterManager.scanResults.listen((printers) async {\n  // store found printers\n});\nprinterManager.startScan(Duration(seconds: 4));\n\n// ...\n\nprinterManager.selectPrinter(printer);\nfinal PosPrintResult res = await printerManager.printTicket(testTicket());\n\nprint('Print result: ${res.msg}');\n```\n\nFor a complete example, check the demo project [example/blue](example/blue).\n\n\n## Troubleshooting\n* If your printer prints only 5%-10% of an image and then stops, or it can't print more than 1 image on the same ticket, or it can't print long tickets, try to ajust `queueSleepTimeMs` of the `PrinterBluetoothManager.printTicket` (try 50 or 100ms): `printerManager.printTicket(await demoReceipt(paper), queueSleepTimeMs: 50);`\n\n\n## Test Print\n\u003cimg src=\"https://github.com/andrey-ushakov/esc_pos_printer/blob/master/example/receipt2.jpg?raw=true\" alt=\"test receipt\" height=\"800\"/\u003e\n\n\u003cimg src=\"https://github.com/andrey-ushakov/esc_pos_printer/blob/master/example/receipt.jpg?raw=true\" alt=\"test receipt\" height=\"500\"/\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrey-ushakov%2Fesc_pos_bluetooth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrey-ushakov%2Fesc_pos_bluetooth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrey-ushakov%2Fesc_pos_bluetooth/lists"}