@moveaxlab/react-native-thermal-printer
TypeScript icon, indicating that this package has built-in type declarations

1.0.7 • Public • Published

react-native-thermal-printer

Getting started

To install the library run the following command:

npm install react-native-thermal-printer --save

Then add this repositories to your android/build.gradle

allprojects {
    repositories {
    	// ...
   
        maven {
                url 'https://nexus.poynt.com/content/repositories/releases'
        }
        
        // ...
    }
}

Mostly automatic installation

$ react-native link react-native-thermal-printer

Manual installation

Android

  1. Open up android/app/src/main/java/[...]/MainActivity.java
  • Add import it.moveax.thermalprinter.ThermalPrinterPackage; to the imports at the top of the file
  • Add new ThermalPrinterPackage() to the list returned by the getPackages() method
  1. Append the following lines to android/settings.gradle:
    include ':react-native-thermal-printer'
    project(':react-native-thermal-printer').projectDir = new File(rootProject.projectDir, 	'../node_modules/react-native-thermal-printer/android')
    
  2. Insert the following lines inside the dependencies block in android/app/build.gradle:
      compile project(':react-native-thermal-printer')
    

Usage

import ThermalPrinter from 'react-native-thermal-printer';

const printer = new ThermalPrinter();

printer.initialize().then(() => {
	printer.addText("Welcome to react-native-thermal-printer!");
	printer.print()
	.then(() => console.log('Print completed!'))
	.catch(e => console.log(e))
}).catch((e) => {
	console.log(e);
});

Supported devices

  • PAX A910/A920
  • Newland N910 (Nexi and Poynt terminals)

Readme

Keywords

Package Sidebar

Install

npm i @moveaxlab/react-native-thermal-printer

Weekly Downloads

13

Version

1.0.7

License

UNLICENSED

Unpacked Size

589 kB

Total Files

54

Last publish

Collaborators

  • gdecicco
  • psenderos
  • lorenzogiustozzi
  • simone.bronzini