百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
R

react-native-thermal-receipt-printer

> 编程语言
开源

热打印机 RN 库

199 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

热打印机 RN 库

react-native-thermal-receipt-printer

Fork of react-native-printer and add implement for auto connect printer with usb A React Native Library to support USB/BLE/Net printer

Installation

bash
yarn add react-native-thermal-receipt-printer

Troubleshoot

  • when install in react-native version >= 0.60, xcode show this error
duplicate symbols for architecture x86_64

that because the .a library uses CocoaAsyncSocket library and Flipper uses it too

Podfile

diff
...
  use_native_modules!

  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable these next few lines.
  # add_flipper_pods!
  # post_install do |installer|
  #   flipper_post_install(installer)
  # end
...

and comment out code related to Flipper in ios/AppDelegate.m

Support

Printer Android IOS
USBPrinter :heavy_check_mark:
BLEPrinter :heavy_check_mark: :heavy_check_mark:
NetPrinter :heavy_check_mark: :heavy_check_mark:

Predefined tag

Tags Description
C Center
D Medium font
B Large font
M Medium font
CM Medium font, centered
CB Medium font, centered
CD Large font, centered

Development workflow

To get started with the project, run yarn bootstrap in the root directory to install the required dependencies for each package:

bash
yarn bootstrap

While developing, you can run the example app to test your changes.

To start the packager:

bash
yarn example start

To run the example app on Android:

bash
yarn example dev-android

To run the example app on iOS:

bash
yarn example ios

Usage

javascript
import {
  USBPrinter,
  NetPrinter,
  BLEPrinter,
} from "react-native-thermal-receipt-printer";

USBPrinter.printText("sample text");
USBPrinter.printBill("sample bill");

Example

USBPrinter (only support android)

typescript
interface IUSBPrinter {
  device_name: string;
  vendor_id: number;
  product_id: number;
}
…

BLEPrinter

typescript
interface IBLEPrinter {
  device_name: string;
  inner_mac_address: string;
}
…

NetPrinter

typescript
interface INetPrinter {
  device_name: string;
  host: string;
  port: number;
}

Note: get list device for net printers is support scanning in local ip but not recommended

…

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Java

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言