infoxicator / react-native-star-prnt

React-Native bridge to communicate with Star Micronics Bluetooth/LAN Printers
MIT License
67 stars 65 forks source link

how to use png file on react-native-star-prnt. #47

Open panda919 opened 4 years ago

panda919 commented 4 years ago

now I am working on react native app using react-native-view-shot and react-native-star-prnt. I got png file for webview by using react-native-view-shot plugin. I gonna print this png file with react-native-star-prnt plugin. pls apply 'react-native print convert' text on your bid top. But this printer plugin doesn't support png, only bitmap. So i think I have to convert react native image module which convert png/jpg to bitmap. Or not How to use png data on printer?

dnlowman commented 4 years ago

The SDK will still process the file in PNG format, React-Native-View-Shot will return a URI which you can then use with the following command:

commands.push({appendBitmap: uri, width: STAR_TICKET_DPI_WIDTH})
await StarPRNT.print(emulation, commands, portName)

If you could provide some code I could help you with your problem!

rockneverdies55 commented 3 years ago

hey @dnlowman - How to figure out the correct value for STAR_TICKET_DPI_WIDTH in your snippet?