Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/growerp/nativescript-escpos-printer
A generic ESCPOS printer plugin for Nativescript, not maintained anymore....
https://github.com/growerp/nativescript-escpos-printer
Last synced: about 1 month ago
JSON representation
A generic ESCPOS printer plugin for Nativescript, not maintained anymore....
- Host: GitHub
- URL: https://github.com/growerp/nativescript-escpos-printer
- Owner: growerp
- License: apache-2.0
- Created: 2020-01-28T01:08:02.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-03-01T09:05:21.000Z (over 4 years ago)
- Last Synced: 2024-09-26T09:21:53.175Z (about 2 months ago)
- Language: Java
- Homepage:
- Size: 2.58 MB
- Stars: 9
- Watchers: 2
- Forks: 2
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nativescript-escpos-printer
Provide a generic printer plugin for ESCPOS thermal printers for android and IOS
This plug is based on:
nativescript-ichi-printer
and ideas used from:
https://www.raywenderlich.com/3437391-real-time-communication-with-streams-tutorial-for-ios#toc-anchor-004This works for Android and IOS and includes full source (swift/java)
use the included printer simulation to show the printouts.
## Installation
```javascript
tns plugin add nativescript-escpos-printer
```## Usage
```javascript
import { Printer } from 'nativescript-escpos-printer';
import { isIOS } from 'tns-core-modules/platform';
var printer = new Printer
printer.print(isIOS? 'localhost' : '10.0.2.2', 9100, "Print test String!")
.then( result => {
if (!result) alert("printer error!")
})
```## API
## License
Apache License Version 2.0, January 2004
## known problems
in IOS, the app will get stuck when a printer is defined, but not found or switched off.
(looks like outputStream.hasSpaceAvailable in IOS swift, always returns false, even if connected)