Problem formatting single line for printing (ESCPOS)

72 Views Asked by At

Pretty new to QZTray (2.2.3) and trying to follow the RAW ESCPOS guide (https://qz.io/docs/raw#escp). I'm using an EPSON TM-T82IIIL printer and trying to determine how to do the following all on a single line:

  1. Print the ISBN of a book (left justified)
  2. Tab stop and print quantity and price per unit
  3. Right align and print the total

Per the ESCPOS specs (https://download4.epson.biz/sec_pubs/pos/reference_en/escpos/esc_la.html), specifically "ESC a" command (alignment), the docs say the following: "When Standard mode is selected, this command is enabled only when processed at the beginning of the line in Standard mode."

I'm no guru at receipt printing, but the right alignment isn't working as expected (the final price is in the middle of the receipt line) and presumably it's because of what's written above?

My code snippet is here:

var book_data = [
    'Weir Do' + '\x0A',  // Book Title
    '9781742837581\t' + '1 @ 15.99' + '\x1B' + '\x61' + '\x32' + '15.99', // right align, // ISBN, quantity and price
    '\x0A' + '\x0A' + '\x0A' + '\x0A' + '\x0A' + '\x0A' + '\x0A',
    '\x1B' + '\x69'          // cut paper (old syntax)
];

I'm hard-coding things for now just to get it working. Any suggestions - I'm not sure right aligning is possible mid-line like this? Thanks for the help!

Cheers,

0

There are 0 best solutions below