leesiongchan / react-native-esc-pos

A React Native ESC/POS module to help you connect to your ESC/POS printer easily.
MIT License
80 stars 84 forks source link

Print image #36

Closed Hetal2425 closed 4 years ago

Hetal2425 commented 4 years ago

I want to print an image on my receipt I am using EscPos.printImage(); . Could anyone please provide me a static image example of what exactly the file.uri should look like and what I have to pass in this function which will help me to print the image logo on top of the print.

EAS-Rhys commented 4 years ago

I would be keen to know this too, I have tried using base64 string, url and imported image and non seem to work, I keep getting:

Attempt to invoke virtual method 'int android.graphics.Bitmap.getWidth()' on a null object reference.

Also @leesiongchan do you have a method for accepting donations, this module has saved us so much time on our current project we'd like to say thank you!

leesiongchan commented 4 years ago

I want to print an image on my receipt I am using EscPos.printImage(); . Could anyone please provide me a static image example of what exactly the file.uri should look like and what I have to pass in this function which will help me to print the image logo on top of the print.

You can try https://github.com/leesiongchan/react-native-esc-pos/issues/24#issuecomment-558902168 to see if it work.

Also @leesiongchan do you have a method for accepting donations, this module has saved us so much time on our current project we'd like to say thank you!

Hi thank you for your generosity, I must say that means a lot! However, I did this for one of my client projects, and the project is completed and I do not have a printer with me to help me further improve the library stability and adding new features. So I don't think I qualify to accept any donations since the quality of the project is not great and I simply can't contribute much on this project anymore.

EAS-Rhys commented 4 years ago

We solved the problem we were having last night, for anyone else having the issue we just requested the external storage permissions and used the file:// path to the image in our case /sdcard/image.bmp in place of file.uri.

@leesiongchan you are very kind but this library has saved us a lot of time and effort so if there is a way to donate we would love to do so. We have forked it and are adding a load more markup options and characters to make it UK friendly as a few of the characters are missing in a lot of pos printers.

On Tue, 5 May 2020 at 03:55, Lee Siong Chan notifications@github.com wrote:

I want to print an image on my receipt I am using EscPos.printImage(); . Could anyone please provide me a static image example of what exactly the file.uri should look like and what I have to pass in this function which will help me to print the image logo on top of the print.

You can try #24 (comment) https://github.com/leesiongchan/react-native-esc-pos/issues/24#issuecomment-558902168 to see if it work.

Also @leesiongchan https://github.com/leesiongchan do you have a method for accepting donations, this module has saved us so much time on our current project we'd like to say thank you!

Hi thank you for your generosity, I must say that means a lot! However, I did this for one of my client projects, and the project is completed and I do not have a printer with me to help me further improve the library stability and adding new features. So I don't think I qualify to accept any donations since the quality of the project is not great and I simply can't contribute much on this project anymore.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/leesiongchan/react-native-esc-pos/issues/36#issuecomment-623807416, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJTG27JMQSQZP6PX34RTLLLRP552HANCNFSM4LPAWBRA .