januslo / react-native-bluetooth-escpos-printer

React-Native plugin for the bluetooth ESC/POS & TSC printers.
MIT License
361 stars 420 forks source link

Image Stretch issue #80

Open ssaadullahwork opened 4 years ago

ssaadullahwork commented 4 years ago

Hi,

I have used below code but my image is still stretching. There is something wrong with the width. Can you please help me.

TSC Code : For this code it is printing something weird text like ? 1/2 ?$ and many other special characters

let imageOptions = { width: 40, height: 30, gap: 20, direction: BluetoothTscPrinter.DIRECTION.FORWARD, reference: [0, 0], tear: BluetoothTscPrinter.TEAR.ON, sound: 0, image: [{x: 160, y: 160, mode: BluetoothTscPrinter.BITMAP_MODE.OVERWRITE,width: 60,image: testImage}] } BluetoothTscPrinter.printLabel(imageOptions);

ESCPOS Code :

await BluetoothEscposPrinter.printPic(testImage, { width: 60, left: 10, })

Where testImage is my base64 image