3

I'm having difficulty printing an image data in page mode. I'm been able to print image data in standard mode as follows:

   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

My (unsuccessful) attempt at printing in page mode is a variation of the above and proceeds as follows:

     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

What am I doing wrong? Do I have to specify a print region or something of the sort?

BTW, I'm programming an Epson TM-T88III.

Olumide
  • 5,397
  • 10
  • 55
  • 104
  • I am also working on printer in android. Can you please tell me how can we execute the POS ESC commands in android – Naresh Sharma Mar 29 '13 at 11:47
  • My Query is http://stackoverflow.com/questions/15701465/how-to-get-the-print-from-the-thermal-printer-in-android – Naresh Sharma Mar 29 '13 at 11:48
  • @NareshSharma Unfortunately I can't help as I am not familiar with the device you're working with. I do not print via any driver but rather send "raw" ESC/POS commands to printers. Sorry. – Olumide Mar 30 '13 at 18:42
  • How can we send a raw ESC/POS command to printer ? Can you please show me. – Naresh Sharma Apr 01 '13 at 04:24
  • See http://nicholas.piasecki.name/blog/2009/12/sending-a-bit-image-to-an-epson-tm-t88iii-receipt-printer-using-c-and-escpos/ A printer will interpret characters sent to it as a command sequence. For example I routinely do `echo Anthing > com3` to test the communication between my computer and printer, where com3 is the serial port to which my printer is connected. Note that this does not work for USB ports. – Olumide Apr 02 '13 at 10:15
  • Thanks for your response and i will try to understand from this that how can i work with printer. – Naresh Sharma Apr 02 '13 at 12:13

1 Answers1

4

Found the answer. Write ESC J n (print and paper feed) command after writing after each 8 x image_width block of pixels to the COM port.

Olumide
  • 5,397
  • 10
  • 55
  • 104