0
I am writing an application which print ticket receipts.
I have some how written the code to print the receipt but the printer either
以超大尺寸字體或非常小尺寸(不可讀)字體打印。 任何機構可以提供我設置格式的代碼。如何設置藍牙打印的字體大小?
try {
//////////this code runs in thread
OutputStream os = mBluetoothSocket
.getOutputStream();
String BILL = "";
BILL = BILL
+ " ********* ";
BILL = BILL+"\n***Invoice No*** \n" +
"Muslim Movers\n"
+Todays_date+"\n";
BILL = BILL + "\n\n";
BILL = BILL + "Tickets:" + " " + String.valueOf(tickets_wanted)+"\n";
BILL = BILL + "Price: "+String.valueOf(Total_Tickets)+"\n"+
Selectedroute+"\n";
BILL = BILL
+ " ********* \n";
////textsize and allignment
byte[] format = { 27, 33, 0 };
byte[] arrayOfByte1 = { 27, 3, 0 };
format[2] = ((byte)(0x10 | arrayOfByte1[2]));
format[2] = ((byte) (0x8 | arrayOfByte1[2]));
} catch (Exception e) {
Log.e("Main", "Exe ", e);
}
t.start();
發佈您的代碼就知道你做了什麼什麼,如果 –