【发布时间】:2019-03-03 21:18:11
【问题描述】:
我需要用热敏打印机 (SAM4S ELLIX40) 打印此图像。
我一直在搜索和测试几个代码,但实际上没有任何效果,他们说“使用这个命令,你会看到一行”,我发送了它,但没有任何反应。
我从手册中尝试了这个命令:
- ESC * m nL nH d1…dk
- GS * x y d1…dk
我尝试最多的是ESC *,但我一直不明白如何设置nL和nH。
String text_to_print = "Hello world!";
DocPrintJob dpj = selected_printjob.createPrintJob();
InputStream stream = new ByteArrayInputStream((text_to_pring).getBytes());
DocFlavor flavor = DocFlavor.INPUT_STREAM.AUTOSENSE;
Doc doc = new SimpleDoc(stream, flavor, null);
dpj.print(doc, null);
【问题讨论】:
标签: java printing thermal-printer escpos