januslo / react-native-bluetooth-escpos-printer

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

printPic error in iOS: blurred image #160

Open elnino710 opened 3 years ago

elnino710 commented 3 years ago

Because the QR code printing failed, I switched to image printing, but I got this error The image is clear at the top (about 5cm) and blurry at the bottom

216872021_264263002138341_634675630947028784_n

Can anyone help me. Thanks

conganwoz commented 3 years ago

Hi! which image capture library did you use for this. I used react-native-view-shot on Android is perfect. But on ios it return strange base64 with multi new line charactor. So my printer can not print (COMMAND_NOT_SEND).

elnino710 commented 3 years ago

Hi AnLuubk. I also use the react-native-view-shot library, everything is fine but the printout is blurry as shown above. I have a discovery before I want to print with iOS, you print with the app provided with the machine (my printer is "nyear label") then the image will be normal, but I don't want to do this

conganwoz commented 3 years ago

Oh! i use nyear label too (NP100). i just adjusted the width 408px (% 8 == 0), it printed out but the quality is bad too (blur), i also had to remove all /\r\n/ in the base64 string before print (if not it return with COMMAND_NOT_SEND). I'm not sure but, I think the quality is bad is caused from base64 string return from ios

elnino710 commented 3 years ago

So have you solved the blur problem yet?

conganwoz commented 3 years ago

211772847_319281479736631_6849299292297871630_n

Not really good! Im trying to adjust the quality return from react-native-view-shot. But still waiting for a better solution

elnino710 commented 3 years ago

My QR code is blurred so I can't read it, it's not really a problem, as long as the QR code is printed I can read it. I will try your way

nvdangbk94 commented 2 years ago

Hi @AnLuubk , I also use react-native-view-shot to capture image and when print that image on Android, image is blurred. Did you find a way to fix it ?

mardikarifqi commented 2 years ago

My experience, in PrintImageBleWriteDelegate there is an NSThread sleepForTimeInterval. Comment that line, and the blur will gone