Coder Social home page Coder Social logo

Comments (13)

januslo avatar januslo commented on July 28, 2024

from react-native-bluetooth-escpos-printer.

shubhamdeol avatar shubhamdeol commented on July 28, 2024

I am on android. I will share my code if you want

from react-native-bluetooth-escpos-printer.

januslo avatar januslo commented on July 28, 2024

from react-native-bluetooth-escpos-printer.

shubhamdeol avatar shubhamdeol commented on July 28, 2024

I am testing on android version 8, and please add manual linking guides as well.

from react-native-bluetooth-escpos-printer.

januslo avatar januslo commented on July 28, 2024

from react-native-bluetooth-escpos-printer.

shubhamdeol avatar shubhamdeol commented on July 28, 2024

from react-native-bluetooth-escpos-printer.

shubhamdeol avatar shubhamdeol commented on July 28, 2024

image

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.

januslo avatar januslo commented on July 28, 2024

Sorry,never tested with expo.

from react-native-bluetooth-escpos-printer.

januslo avatar januslo commented on July 28, 2024

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.

shubhamdeol avatar shubhamdeol commented on July 28, 2024

from react-native-bluetooth-escpos-printer.

januslo avatar januslo commented on July 28, 2024

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.

shubhamdeol avatar shubhamdeol commented on July 28, 2024

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 :(

image

from react-native-bluetooth-escpos-printer.

shubhamdeol avatar shubhamdeol commented on July 28, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.