A Turbo Module wrapper for the Epson ePOS Printer SDK.
npm install react-native-epson-escposprinterA React Native wrapper of the
Epson ePOS SDK,
supporting the
New Architecture
and classic builds.
The current version embeds these SDKs:
1. Epson ePOS SDK for Android Version 2.32.0
1. Epson ePOS SDK for iOS Version 2.32.0
Most of the methods are a simple wrapper of the native SDK. For a complete list
of methods and their details, you may refer to the API reference file found in
the Epson SDK archive.
``tsx
import {
connect,
discoverPrinters,
getPrinterSeriesFromDeviceName,
PrinterLocale,
} from "react-native-epson-escposprinter";
import { ok } from "assert";
for await (const info of discoverPrinters()) {
const series = getPrinterSeriesFromDeviceName(info.deviceName);
ok(series, Unknown device ${info.deviceName});
const printer = await connect(series, PrinterLocale.MODEL_ANK, info.target);
await printer.transaction(async () => {
await printer.addText("ABC");
await printer.sendData();
await printer.clearCommandBuffer();
});
await printer.disconnect();
}
`
`tsx
import { Log, LogPeriod } from "react-native-epson-escposprinter";
// Store SDK logs locally, you must include relevant file system capabilities.
await Log.enableLocal(LogPeriod.PERIOD_PERMANENT);
// Send SDK logs to a network endpoint, you must include network capabilities.
await Log.enableNetwork("1.2.3.4", 5678);
// Stop recording SDK logs
await Log.disable();
`
1. yarn installcd examples/testprint-app
1. yarn arch:new
1. Prebuild in New Architecture by running , or runyarn arch:old
to test in legacy environments.yarn android
1. Run to test in Androidyarn ios` to test in iOS
1. Run
See the contributing guide to learn how to contribute to the
repository and the development workflow.
If you use this library at work, consider
sponsoring for a first-class technical
support.