ESC-POS代码用于以页面模式打印图像数据

时间:2011-12-12 12:26:13

标签: printing escaping point-of-sale epson thermal-printer

我在页面模式下打印图像数据时遇到困难。我能够以标准模式打印图像数据,如下所示:

   data[] = { ESC   , 
              '*'   ,
                0   , // 8-dot single density mode
              width , // nl: image width
                0   } // nh: image width

   for each 8 x image_width block of pixels in a monochrome image
        for each 8 x 1 (vertical) strip of pixels in the block
             append pixel (0 or 1) data to the array, data[]
        write data to COM port

我的(不成功)尝试以页面模式打印是上述内容的变体,其过程如下:

     select page mode by writing the chars, ESC and 'L' to the COM port
     write pixel data as described above
     print by writing the characters ESC and FF

我做错了什么?我是否必须指定打印区域或类似的东西?

顺便说一下,我正在编写一部爱普生TM-T88III。

1 个答案:

答案 0 :(得分:3)

找到答案。在每个8 x image_width像素块写入COM端口后写入ESC J n(打印和进纸)命令。