Comments (13)
from react-native-bluetooth-escpos-printer.
I am on android. I will share my code if you want
from react-native-bluetooth-escpos-printer.
from react-native-bluetooth-escpos-printer.
I am testing on android version 8, and please add manual linking guides as well.
from react-native-bluetooth-escpos-printer.
from react-native-bluetooth-escpos-printer.
from react-native-bluetooth-escpos-printer.
see, here is the screenshoot of warning I am receiving with printLabel.
and I am passing options as
initPrint = async () => {
const options = {
width: 40,
height: 30,
gap: 20,
direction: BluetoothTscPrinter.DIRECTION.FORWARD,
reference: [0, 0],
tear: BluetoothTscPrinter.TEAR.ON,
sound: 0,
text: [{
text: 'I am a testing txt',
x: 20,
y: 0,
fonttype: BluetoothTscPrinter.FONTTYPE.SIMPLIFIED_CHINESE,
rotation: BluetoothTscPrinter.ROTATION.ROTATION_0,
xscal:BluetoothTscPrinter.FONTMUL.MUL_1,
yscal: BluetoothTscPrinter.FONTMUL.MUL_1
},{
text: '你在说什么呢?',
x: 20,
y: 50,
fonttype: BluetoothTscPrinter.FONTTYPE.SIMPLIFIED_CHINESE,
rotation: BluetoothTscPrinter.ROTATION.ROTATION_0,
xscal:BluetoothTscPrinter.FONTMUL.MUL_1,
yscal: BluetoothTscPrinter.FONTMUL.MUL_1
}],
qrcode: [{x: 20, y: 96, level: BluetoothTscPrinter.EEC.LEVEL_L, width: 3, rotation: BluetoothTscPrinter.ROTATION.ROTATION_0, code: 'show me the money'}],
barcode: [{x: 120, y:96, type: BluetoothTscPrinter.BARCODETYPE.CODE128, height: 40, readable: 1, rotation: BluetoothTscPrinter.ROTATION.ROTATION_0, code: '1234567890'}],
// image: [{x: 160, y: 160, mode: BluetoothTscPrinter.BITMAP_MODE.OVERWRITE,width: 60,image: base64Image}]
}
BluetoothTscPrinter.printLable(options)
.then(()=>{
//success
},
(err)=>{
//error
})
from react-native-bluetooth-escpos-printer.
Sorry,never tested with expo.
from react-native-bluetooth-escpos-printer.
you may need to do some alert/log in the index.js to figure out what is the problem. It's a good idea to start with the NativeModules after this line:
const {BluetoothManager,BluetoothEscposPrinter,BluetoothTscPrinter}= NativeModules;
from react-native-bluetooth-escpos-printer.
from react-native-bluetooth-escpos-printer.
Here is a real case as a sample :
await BluetoothTscPrinter.printLabel({
width: labelConfig.width,
height: labelConfig.height,
gap: labelConfig.gap,
direction: BluetoothTscPrinter.DIRECTION.FORWARD,
reference: [0, 0],
tear: BluetoothTscPrinter.TEAR.ON,
sound: 1,
text: texts,
barcode: barCode,
home: 0
});
No everything need for printing a label. further more , printLabel not printlabel
from react-native-bluetooth-escpos-printer.
okay, so if I don't want image, and I want barcode only in that case it won't work ?
see, here I am getting this function, but properties like DIRECTION are not getting attached to object may be :(
from react-native-bluetooth-escpos-printer.
hey tell me one more thing, if BluetoothEscposPrinter and BluetoothTscPrinter are different kind of printer. I have Escposprinter, so maybe it does not detect BluetoothTscPrinter
from react-native-bluetooth-escpos-printer.
Related Issues (20)
- 'imageRef passed is not a CGImageRef' was thrown while invoking printQRCode
- Can not Connect in iOS HOT 2
- App crash when connnecting Bluetooth on android 14 HOT 5
- Scan Error HOT 2
- hasil dari print TSC menampilkan seluruh fungsi dari options, bagaimana cara mengatasinya HOT 1
- korean language?
- Remove white space after print image ?
- Best printer package, but we need an update!!!! HOT 2
- Application crashes on android versions greater than 10. HOT 3
- I cannot print accented Vietnamese
- Measurement are not correct?
- How to upload react-native-bluetooth-escpos-printer without node module HOT 1
- How to print using Serial Port (Com Port) ?
- Does anyone continue to maintain this library? HOT 2
- Bluetooth printing error: Printer feeds paper but doesn't complete printing
- how i can set print multi language??
- Hello @vgvishal538 Have You Found Any Encoding That Print Indian Languages ? Please Tell Me. HOT 1
- Mobile Preview before Print HOT 1
- How to use this in the latest expo framework HOT 2
- Supported printers
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-bluetooth-escpos-printer.