网上教程太多了,也不知道看哪个,谁做过这个东西,从一个文本文档中取数据,然后打印到我指定的坐标上,有没有谁学习过这个技能,给个教程连接好吗

解决方案 »

  1.   

    我做过POS小票打印机的打印,网线或无线直连,直接发送命令到打印机。
    示例如:
    /*
    * 命令:设定水平定位点
    */
    public static boolean order_SetHorizontalPosition() {
    boolean opstat = false;
    byte[] order = new byte[] { ESC, 0x44,
    Integer.valueOf(4).byteValue(),
    Integer.valueOf(8).byteValue(),
    Integer.valueOf(12).byteValue(),
    Integer.valueOf(16).byteValue(),
    Integer.valueOf(20).byteValue(),
    Integer.valueOf(24).byteValue(),
    Integer.valueOf(28).byteValue()};
    try {
    output.write(order);
    output.flush();
    opstat = true;
    } catch (IOException e) {
    e.printStackTrace();
    }
    return opstat;
    }
    你可以找一下ESC打印命令
      

  2.   

    直接使用JDesktop来进行指印控制