Using android M
, This android java native app is POS app that have functional to print receipt to termal printer by image over Bluetooth. So I need to generate image as JPG file by using form that ready designed by html file. In this template contain CSS and javascript in local storage of android device.
Asked
Active
Viewed 159 times
0

Bong Channarith
- 241
- 1
- 2
- 10
1 Answers
1
If you are displaying the receipt html in, say, a WebView, you can basically take a screenshot of the WebView and save it as a bitmap, then write it out to external storage (you'll need to add permissions for writing to External Storage). Once saved as a bitmap, you'll have to figure out how to print it to the terminal printer.
There is another Question that shows the code for how to do this here:

Michael Dougan
- 1,698
- 1
- 9
- 13