【发布时间】:2012-08-28 17:45:44
【问题描述】:
我通过我的安卓手机将文本发送到蓝牙打印机。 打印机和我的设备都通过蓝牙连接。 它工作正常,我在纸上得到了所需的文字。
我的问题是:
打印机采用默认的font size 文本。我想更改要打印的文本的字体大小。
我怎样才能做到这一点??
这是我在蓝牙连接后打印文本的代码:
private void connect_print(BluetoothDevice bluetoothDevicess) {
// some code
printData();
// some code
}
printData() 方法
private void printData() {
// TODO Auto-generated method stub
String str = new String("This is the text sending to the printer");
String newline = "\n";
try {
out.write(str.getBytes(),0,str.getBytes().length);
Log.i("Log", "One line printed");
} catch (IOException e) {
Toast.makeText(BluetoothDemo.this, "catch 1", Toast.LENGTH_LONG).show();
e.printStackTrace();
Log.i("Log", "unable to write ");
flagCheck = false;
}
try {
out.write(newline.getBytes(),0,newline.getBytes().length);
} catch (IOException e) {
Log.i("Log", "Unable to write the new line::");
e.printStackTrace();
flagCheck = false;
}
flagCheck = true;
}
我想更改发送到打印机进行打印的文本的font size 和font style。
请帮助我实现这一目标。
如果有人可以建议任何链接,那么我也会很感激他/她。
帮我找到解决这个问题的方法
【问题讨论】:
-
请建议我在这种情况下应该怎么做?
-
谁能告诉我我要在这里做什么
-
还没有得到任何答案
-
仍在寻找解决方案。有人可以帮帮我吗?
-
投反对票很久了,但投反对票的人仍然没有任何评论。无论如何,谢谢。
标签: android printing bluetooth