I need to construct my own print receipt.where some text should be centre align ,left align, right align ,some text should be bold . kindly help me out how can i achieve this
Thanks Isha shahu
Query:- What is the print format?
If you want to format your own receipt, you can either,
TextPrintJob
. You can send simple lines of text. Any formatting has to be achieved by adding spaces and blank lines, etc.ViewPrintJob
. This allows you to format the receipt using formatting mechanisms available via the Android View
hierarchy.ImagePrintJob
. Here you send an Android Bitmap
, and how you format the pixels therein is up to you.There is no sample for that. What's your question?
PrintJob pj = new ViewPrintJob.Builder().view(view).print(...);
As for how to construct the view, that's a general Android question that you'd be better off consulting the developer resources offered by Google.
2 People are following this question.