Surile / react-native-sunmi-printer

商米内置打印机
MIT License
44 stars 28 forks source link

printBitmap() is not working #17

Closed Rehankhalil462 closed 1 year ago

Rehankhalil462 commented 1 year ago

when try to print an image by providing a encoded string and pixelWidth , it throws a error " width and height must be >0" .

Environment : "expo": "~46.0.9", "react": "18.0.0", "react-native": "0.69.5",

Rehankhalil462 commented 1 year ago

I found the solution for "width and height must be > 0" issue.

The image that we are trying to print from the printer has greater width than the receipt of the printer. So, image should be within the 384 width or maybe less than 384. Pass 384 as a pixelwidth of printbitmap method and provide the base64 string of image with the width less than 384 if you are using 58mm paper printer.