NTP 5 Slve
NTP 5 Slve
Printer from your own android application via Bluetooth Print app
Bluetooth Print App URL: https://play.google.com/store/apps/details?
id=mate.bluetoothprint
You can print with Bluetooth Print app from your own Android app by passing data
through Intent
2. Print image
Add <IMAGE>A#Base64; where
A: align status and value must be 0 if left, 1 if center, 2 if right
Base64: Base 64 encoded string derived from below function
3. Print Barcode
Add <BARCODE>A#W#H#Value; where
A: align status and value must be 0 if left, 1 if center, 2 if right
W: Valid barcode width
H: Valid barcode height
Value: Valid barcode value
e.g. str = str + "<BARCODE>0#100#50#2132137538472";
4. Print QR Code
Add <QR>A#S#Value; where
A: align status and value must be 0 if left, 1 if center, 2 if right
S: QR Code Size
Value: Valid QR Code value
e.g. str = str + "<QR>1#50#This is sample";
5. Print HTML
Add <HTML>Code where
Code: This is an HTML code to be printed; Put escape character before "
e.g. str = str + "<HTML>" + getHTMLEquivalent("<div><div
style=\"float:left;\"><b>This is left</b></div><div style=\"float:right;font-
size:15px;\">This is right</div></div>");
To say in simple words, You can create an example string like below
String imgpath =
Environment.getExternalStorageDirectory().toString()+"/BluetoothPrint/test.jpg";
String str = "<113>Mate Technologies<100>Website: www.matetech.in\nEmail:
[email protected]<IMAGE>1#"+imgpath;
str = str + "<BARCODE>0#100#50#2132137538472<QR>1#40#testing text";
str = str + "<HTML><div><div style=\"float:left;\"><b>This is left</b></div><div
style=\"float:right;font-size:15px;\">This is right</div></div>";
Note: If any non english entry is added, it will get auto get converted to text
special if this setting is on in the app. You will find this setting in Settings-
>Special Characters