2019独角兽企业重金招聘Python工程师标准>>>

package com.project.base;

import java.awt.Color; import java.awt.Font; import java.awt.Graphics; import java.awt.Image; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.Enumeration; import java.util.List; import java.util.TooManyListenersException;

import javax.imageio.ImageIO;

import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException;

public class SerialTool {

private static SerialTool serialTool = null;static {//在该类被ClassLoader加载时就初始化一个SerialTool对象if (serialTool == null) {serialTool = new SerialTool();}
}//私有化SerialTool类的构造方法,不允许其他类生成SerialTool对象
private SerialTool() {}    /*** 获取提供服务的SerialTool对象* [@return](https://my.oschina.net/u/556800) serialTool*/
public static SerialTool getSerialTool() {if (serialTool == null) {serialTool = new SerialTool();}return serialTool;
}/*** 查找所有可用端口* [@return](https://my.oschina.net/u/556800) 可用端口名称列表*/
public static ArrayList<String> findPort() {//获得当前所有可用串口Enumeration<CommPortIdentifier> portList = CommPortIdentifier.getPortIdentifiers();    ArrayList<String> portNameList = new ArrayList<>();//将可用串口名添加到List并返回该Listwhile (portList.hasMoreElements()) {String portName = portList.nextElement().getName();portNameList.add(portName);}return portNameList;
}/*** 打开串口* [@param](https://my.oschina.net/u/2303379) portName 端口名称* [@param](https://my.oschina.net/u/2303379) baudrate 波特率* [@return](https://my.oschina.net/u/556800) 串口对象* @throws SerialPortParameterFailure 设置串口参数失败* @throws NotASerialPort 端口指向设备不是串口类型* @throws NoSuchPort 没有该端口对应的串口设备* @throws PortInUse 端口已被占用*/
public static SerialPort openPort(String portName, int baudrate) {try {//通过端口名识别端口CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName);//打开端口,并给端口名字和一个timeout(打开操作的超时时间)date = new Date();System.out.println("before commPort:"+sdf.format(date)); CommPort commPort = portIdentifier.open(portName, 2000);date = new Date();System.out.println("affter commPort:"+sdf.format(date)); //判断是不是串口if (commPort instanceof SerialPort) {SerialPort serialPort = (SerialPort) commPort;try {                        //设置一下串口的波特率等参数date = new Date();System.out.println("before baudrate:"+sdf.format(date));                 serialPort.setSerialPortParams(baudrate, SerialPort.DATABITS_8, SerialPort.STOPBITS_2, SerialPort.PARITY_NONE);  date = new Date();System.out.println("affter baudrate:"+sdf.format(date));                    } catch (UnsupportedCommOperationException e) {  //throw new UnsupportedCommOperationException();}//System.out.println("Open " + portName + " sucessfully !");return serialPort;}        else {//不是串口//throw new UnsupportedCommOperationException();return null;}} catch (NoSuchPortException e1) {//throw new NoSuchPortException();return null;} catch (PortInUseException e2) {//throw new PortInUseException();return null;}
}/*** 关闭串口* @param serialport 待关闭的串口对象*/
public static void closePort(SerialPort serialPort) {if (serialPort != null) {serialPort.close();serialPort = null;}
}/*** 往串口发送数据* @param serialPort 串口对象* @param order    待发送数据* @throws SendDataToSerialPortFailure 向串口发送数据失败* @throws SerialPortOutputStreamCloseFailure 关闭串口对象的输出流出错*/
public static void sendToPort(SerialPort serialPort, byte[] order) {OutputStream out = null;try {out = serialPort.getOutputStream();out.write(order);out.flush();} catch (IOException e) {//throw new SendDataToSerialPortFailure();} finally {try {if (out != null) {out.close();out = null;}                } catch (IOException e) {//throw new SerialPortOutputStreamCloseFailure();}}}/*** 从串口读取数据* @param serialPort 当前已建立连接的SerialPort对象* @return 读取到的数据* @throws ReadDataFromSerialPortFailure 从串口读取数据时出错* @throws SerialPortInputStreamCloseFailure 关闭串口对象输入流出错*/
public static byte[] readFromPort(SerialPort serialPort)  {InputStream in = null;byte[] bytes = null;try {in = serialPort.getInputStream();int bufflenth = in.available();        //获取buffer里的数据长度while (bufflenth != 0) {                             bytes = new byte[bufflenth];    //初始化byte数组为buffer中数据的长度in.read(bytes);bufflenth = in.available();} } catch (IOException e) {//throw new ReadDataFromSerialPortFailure();} finally {try {if (in != null) {in.close();in = null;}} catch(IOException e) {//throw new SerialPortInputStreamCloseFailure();}}return bytes;}/*** 添加监听器* @param port     串口对象* @param listener 串口监听器* @throws TooManyListeners 监听类对象过多*/
public static void addListener(SerialPort port, SerialPortEventListener listener) {try {//给串口添加监听器port.addEventListener(listener);//设置当有数据到达时唤醒监听接收线程port.notifyOnDataAvailable(true);//设置当通信中断时唤醒中断线程port.notifyOnBreakInterrupt(true);} catch (TooManyListenersException e) {//throw new TooManyListeners();}
}
public static Date date = new Date();
public static SimpleDateFormat sdf = new SimpleDateFormat("YYYY/MM/dd HH:mm:ss.SSS");
public static void main(String[] args) {/*SerialPort sp = SerialTool.openPort("COM8", 9600);      byte[] turnOffAll = new byte[]{ 0x68,0x05,0x1f,0x55,0x00,0x79,0x43};byte[] turnOnLED1 = new byte[]{ 0x68,0x05,0x10,0x02,0x00,0x17,0x43};byte[] flashLED2 = new byte[]{ 0x68,0x05,0x11,0x01,0x00,0x17,0x43};     if (sp != null)SerialTool.sendToPort(sp, turnOffAll);      if (sp != null)SerialTool.sendToPort(sp, turnOnLED1);  if (sp != null)SerialTool.sendToPort(sp, flashLED2);           SerialTool.closePort(sp);

*/ date = new Date(); System.out.println("before openCom:"+sdf.format(date));
SerialPort sp = SerialTool.openPort("COM2", 9600); int[] rgb = new int[3]; List<Byte> cmdList = new ArrayList<Byte>(); byte[] data = new byte[] { 0x00, 0x00, 0x00 }; // ESC * m nL nH
byte[] escBmp = new byte[] { 0x1B, 0x2A, 0x00, 0x00, 0x00 }; byte[] GSVM = { 0x1d, 0x56, 0x42, 0x00 }; //切纸 escBmp[2] = 0x21; date = new Date(); System.out.println("start:"+sdf.format(date));
try { File f = new File("d:\temp.bmp"); BufferedImage bi = ImageIO.read(f); Graphics g = bi.getGraphics(); Font font = new Font("隶书", Font.BOLD, 20); g.setColor(Color.BLACK); g.setFont(font); g.drawString("这是套打的文字12345678", 250, 200); //g.create(0,0,352,264); //g.drawImage(bi, 0, 0,null); int width=bi.getWidth(); int height=bi.getHeight(); int minx=bi.getMinX(); int miny=bi.getMinY(); System.out.println("width="+width+",height="+height+"."); System.out.println("minx="+minx+",miniy="+miny+"."); //nL, nH
escBmp[3] = (byte)(width % 256); escBmp[4] = (byte)(width / 256);

        date = new Date();System.out.println("before data:"+sdf.format(date));  // data  for (int i = 0; i < (height / 24) + 1; i++){for (int n = 0; n < 5; n++)cmdList.add(escBmp[n]);for (int j = 0; j < width; j++){for (int k = 0; k < 24; k++){if (((i * 24) + k) < height)   // if within the BMP size  {int pixel=bi.getRGB(j, (i * 24) + k); rgb[0] = (pixel & 0xff0000 ) >> 16 ; //rgb[1] = (pixel & 0xff00 ) >> 8 ; //rgb[2] = (pixel & 0xff); //System.out.println("i="+i+",j="+j+":("+rgb[0]+","+rgb[1]+","+rgb[2]+")");if ((rgb[0]) < 75){data[k / 8] += (byte)(128 >> (k % 8));}}}for (int n = 0; n < 3; n++)cmdList.add(data[n]);data[0] = 0x00;data[1] = 0x00;data[2] = 0x00;    // Clear to Zero.  }} // data            date = new Date();System.out.println("after data:"+sdf.format(date));           }catch(Exception e){}finally{}

// for (int i=0;i<cmdList.size();i++) // System.out.println(cmdList.get(i)); date = new Date(); System.out.println("before array to byte[]:"+sdf.format(date)); Byte[] order = new Byte[cmdList.size()]; cmdList.toArray(order); // ; // for (int i=0;i<cmdList.size();i++) // { // //System.out.println(cmdList.get(i)); // order[i] = (int)cmdList.get(i); // } date = new Date(); System.out.println("after array to byte[]:"+sdf.format(date));
// TODO Auto-generated method stub // int[] order = {0x1b,0x2a,0x21,0x60,0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0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x70,0x38,0x38,0x70,0x38,0x38,0x70,0x38,0x38,0x70,0x38,0x38,0x70,0x38,0x3f,0xf8,0x38,0x3f,0xfe,0x38,0x3f,0xff,0x38,0x3f,0xff,0x38,0x3f,0xff,0x38,0x38,0x7f,0x38,0x38,0x70,0x38,0x38,0x70,0x38,0x78,0x70,0x3f,0xf8,0x70,0x3f,0xf0,0x70,0x3f,0xf0,0x70,0x3f,0xf0,0x70,0x3f,0xc0,0x70,0x0,0x0,0x70,0x0,0x0,0x70,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x3f,0xff,0xff,0x3f,0xff,0xff,0x3f,0xff,0xff,0x3f,0xff,0xff,0x3f,0xff,0xff,0x38,0x0,0x0,0x38,0x0,0xc0,0x38,0x1c,0xe0,0x38,0x38,0xe0,0x38,0x78,0xe0,0x3b,0xf0,0xe0,0x3b,0xf0,0xe1,0x3b,0xe0,0xe3,0x3b,0xe0,0xc3,0x3a,0xe0,0xc7,0x38,0xe0,0xff,0x38,0xf5,0xff,0x38,0xff,0xfe,0x38,0xff,0xfc,0x38,0xff,0xfc,0x38,0xff,0xfe,0x38,0xe0,0xff,0x38,0xe0,0xef,0x38,0xe0,0xc7,0x38,0xe0,0xe3,0x38,0xe0,0xc1,0x38,0xe0,0xe1,0x38,0xe0,0xe0,0x38,0x60,0xe0,0x38,0x0,0xc0,0x30,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x3f,0xff,0xff,0x3f,0xff,0xff,0x3f,0xff,0xff,0x38,0x0,0x0,0x38,0x0,0x0,0x38,0x1e,0x0,0x3b,0xff,0x81,0x3f,0xff,0xff,0x3f,0xfb,0xff,0x3f,0xc0,0xff,0x0,0x0,0x0,0x1f,0x80,0x70,0x1f,0x80,0x70,0x1f,0x98,0x70,0x1f,0xb8,0x70,0x1c,0x38,0x7f,0x1c,0x38,0x7f,0x1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0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}; //SerialTool.findPort();

   if (sp != null)SerialTool.sendToPort(sp, ByteArrayTobyteArray(order));date = new Date();System.out.println("after print:"+sdf.format(date));       SerialTool.sendToPort(sp, GSVM);SerialTool.closePort(sp);

/* byte[] HRI = { 0x1d, 0x48 ,0x00}; //可读字符打印位置-不打印 byte[] HRI_01 = { 0x1d, 0x48, 0x01 }; //可读字符打印位置-条码上方 byte[] HRI_02 = { 0x1d, 0x48, 0x02 }; //可读字符打印位置-条码下方 byte[] HRI_03 = { 0x1d, 0x48, 0x03 }; //可读字符打印位置-条码上方和下方 byte[] BARHIGHT = { 0x1d, 0x68, 0x00 }; //条码高度,最后一字节需换成实际的高1-255 byte[] BARWIDTH = { 0x1d, 0x77, 0x00 }; //条码宽度,最后一字节需换成实际的宽1-6 byte[] CODE_39 = { 0x1d, 0x6b, 0x45, 0x00}; //CODE39,最后一字节需替换成实际条码长度 byte[] CODE_128 = { 0x1d, 0x6b, 0x49, 0x00 }; //CODE128,最后一字节需替换成实际条码长度 byte[] UPC_A = {0x1d, 0x6b, 0x41, 0x00 }; //CPC_A,最后一字节需替换成实际条码长度 byte[] CODABAR = { 0x1d, 0x6b, 0x47, 0x00 }; //CODABAR,最后一字节需替换成实际条码长度 byte[] ESCAT = { 0x1b, 0x40 };//初始化打印机
byte[] GSVM = { 0x1d, 0x56, 0x42, 0x00 }; //切纸
byte[] feedCmd = { 0x1b, 0x64, 0x03 }; byte[] CRLF = { 0x1d, 0x0a}; //换行走纸 byte[] FSAND = { 0x1c, 0x26 };//选择汉字模式 byte[] FSDEL = { 0x1c, 0x2e };//取消汉字模式

    SerialPort sp = SerialTool.openPort("COM2", 9600);   if (sp != null){SerialTool.sendToPort(sp, ESCAT);BARHIGHT[2] = 0x64;SerialTool.sendToPort(sp, BARHIGHT);  BARWIDTH[2] = 0x02;SerialTool.sendToPort(sp, BARWIDTH);            SerialTool.sendToPort(sp, HRI_02);  String str = "320102197809240813";byte[] order = str.getBytes();CODE_39[3] = (byte) order.length;byte[] data = new byte[4 + order.length];for (int i=0;i < 4; i++)data[i] = CODE_39[i];for (int i = 0; i < order.length; i++)data[4 + i] = order[i];          SerialTool.sendToPort(sp, data);    for (int i = 0; i < 4; i++){SerialTool.sendToPort(sp, ESCAT);SerialTool.sendToPort(sp, FSAND);SerialTool.sendToPort(sp, new byte[]{0x0A});SerialTool.sendToPort(sp,CRLF);SerialTool.sendToPort(sp,FSDEL);}SerialTool.sendToPort(sp,GSVM);}SerialTool.closePort(sp);       */
}public static byte[] IntArrayToByteArray(int[] intArray)
{byte[] iretVal = new byte[intArray.length];for (int i=0 ; i < iretVal.length ; i++)iretVal[i] = (byte)intArray[i];return iretVal;
}public static byte[] ByteArrayTobyteArray(Byte[] ByteArray)
{date = new Date();System.out.println("before Byte to byte:"+sdf.format(date));     byte[] iretVal = new byte[ByteArray.length];for (int i=0 ; i < iretVal.length ; i++)iretVal[i] = ByteArray[i];date = new Date();System.out.println("after Byte to byte:"+sdf.format(date));     return iretVal;
}

}

转载于:https://my.oschina.net/xueptao/blog/3042993

ESC/POS 打印机指令相关推荐

  1. EPSON ESC/POS打印机指令

    原文地址::http://blog.csdn.net/feng88724/article/details/17474351 相关文章 1.微型热敏打印机指令集----https://wenku.bai ...

  2. 安卓开发ESC/POS打印机打印

    ESC/POS打印机打印 主要记录一下主要代码 一.设置文字对齐: mWriter.write(0x1b); mWriter.write(0x61); mWriter.write(alignment) ...

  3. Android进阶——安卓调用ESC/POS打印机打印

    前言 前一段时间由于工作需要,要研究一下安卓程序调用打印机打印小票,并且要求不能使用蓝牙调用,研究了一下,可以利用socket连接,来实现打印功能.写了个Demo,分享一下. 工具:一台打印机(芯烨X ...

  4. python调用打印机打印图片_Python使用Python将图像位数据打印到ESC/POS打印机

    我一直在寻找一个如何格式化和打印bmp到我的收据打印机(这样我可以添加徽标)的例子很长一段时间,所以我怀疑这是一个重复的帖子考虑到其他人是为java或其他脚本语言.通常我很擅长理解指令,但我发现的只是 ...

  5. python发送esc_使用win32prin将一行文本发送到Python中的ESC/POS打印机

    我正在尝试将一行文本发送到使用win32api的ESC/p热敏打印机.在 我知道pythonsecpos的存在,但我想了解原始打印是如何工作的.在 连接打印机并将其配置为默认打印机.在windows设 ...

  6. pos打印机指令java,如何从Delphi向POS打印机发送控制命令

    我已经尝试了很多,最后我写了这个有效的代码: procedure Cut(); var epsonprn : System.Text; begin try AssignFile(epsonprn,'C ...

  7. java escpos_java – 设置字符代码表以在ESC / POS打印机中打印非拉丁字符

    不确定这是一个答案,但希望这将开始.还需要一点空间来解释-- 看起来代码页850没有所需的字符.离线检查的一种简单方法是转换回String.例如. : System.out.println( new ...

  8. POS58票据热敏打印机,怎么用ESC/POS命令控制打印

    POS58票据热敏打印机,怎么用ESC/POS命令控制打印 时间:2010-09-02 12:43 来源: 作者: 点击: - POS58票据热敏打印机,怎么用ESC/POS命令控制打印文字大小? 使 ...

  9. Android 蓝牙/wifi云打印机 ESC/POS热敏打印机打印(ESC/POS指令篇)

    上一篇主要介绍了如何通过蓝牙打印机和wifi云打印机的连接与数据发送,这一篇,我们就介绍向打印机发送打印指令,来打印字符和图片. 由于公司暂且买了两台打印机,一台佳博GP-58MIII,一台GP-SH ...

最新文章

  1. 配置Keil C51配置开发 STC51单片机过程
  2. $.ajax的type属性,$.ajax中contentType属性为“application/json”和“application/x-www-form-urlencoded”的区别...
  3. 【PSO运输优化】基于MATLAB的PSO运输优化算法的仿真
  4. C++类与static关键字
  5. 实现Operations Manager 2012 R2单一部署
  6. FusionCharts参数的详细说明和功能特性
  7. linux shell 中文件编码查看及转换方法
  8. LeetCode234题:回文链表
  9. 利用oc门或od门实现线与_福师《数字逻辑》在线作业二答案
  10. 5.Docker之镜像的使用
  11. GJB150A湿热试验-高低温交变湿热试验标准检测报告
  12. 固高控制卡Home捕获和Index捕获
  13. 计算机系统时间错了,电脑时间同步出错怎么办
  14. C++对象模型探索视频课程
  15. 简单介绍JVM的GC过程
  16. 一战北邮计专考研经验分享
  17. 身份证验证判断、身份证正则表达式、15位、18位身份证验证
  18. SDN入门:Ubuntu下SDN环境搭建(Floodlight+Minite)(踩坑教程,解决FL1.2版本无法访问网页问题)
  19. django实现websocket作为安卓开发后台(软件课设,oo聊天)
  20. syntactic sugar - 语法糖 - 糖衣语法

热门文章

  1. USB无线网卡共享台式机接入ADSL无线上网
  2. C语言 编写函数Fun1实现分段函数运算,并返回函数值。在主函数调用Fun1函数,接收输入的x值,并输出函数值。
  3. ubuntu 修改默认用户名_Ubuntu更改用户名的方法
  4. 如何查看电脑是否支持Wi-Fi 6
  5. VC++编写USB接口通讯程序
  6. android平台下OpenGL ES 3.0绘制纯色背景
  7. 记录一次使用Autowired报Nullpoint空指针异常的错误
  8. 模型量化(6):Yolov5 QAT量化训练
  9. 使用wiki百科的中文语料库训练词向量
  10. 1118: 继续畅通工程