Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
panda919 opened this issue Sep 11, 2019 · 2 comments
Open

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

panda919 opened this issue Sep 11, 2019 · 2 comments

Comments

@panda919
Copy link

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
Copy link
Collaborator

dnlowman commented Dec 16, 2019

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants