QR Code creation with ESC / POS

borhane

Member
hello sir Please help me to change this procedure to language progress Openedge 10.2B thank you in advance.

Code:
public void print_qr_code(String qrdata)
{
    int store_len = qrdata.length() + 3;
    byte store_pL = (byte) (store_len % 256);
    byte store_pH = (byte) (store_len / 256);


    // QR Code: Select the model
    //              Hex     1D      28      6B      04      00      31      41      n1(x32)     n2(x00) - size of model
    // set n1 [49 x31, model 1] [50 x32, model 2] [51 x33, micro qr code]
    // epson-biz.com - Epson
    byte[] modelQR = {(byte)0x1d, (byte)0x28, (byte)0x6b, (byte)0x04, (byte)0x00, (byte)0x31, (byte)0x41, (byte)0x32, (byte)0x00};

    // QR Code: Set the size of module
    // Hex      1D      28      6B      03      00      31      43      n
    // n depends on the printer
    // epson-biz.com - Epson
    byte[] sizeQR = {(byte)0x1d, (byte)0x28, (byte)0x6b, (byte)0x03, (byte)0x00, (byte)0x31, (byte)0x43, (byte)0x03};


    //          Hex     1D      28      6B      03      00      31      45      n
    // Set n for error correction [48 x30 -> 7%] [49 x31-> 15%] [50 x32 -> 25%] [51 x33 -> 30%]
    // epson-biz.com - Epson
    byte[] errorQR = {(byte)0x1d, (byte)0x28, (byte)0x6b, (byte)0x03, (byte)0x00, (byte)0x31, (byte)0x45, (byte)0x31};


    // QR Code: Store the data in the symbol storage area
    // Hex      1D      28      6B      pL      pH      31      50      30      d1...dk
    // epson-biz.com - Epson
    //                        1D          28          6B         pL          pH  cn(49->x31) fn(80->x50) m(48->x30) d1…dk
    byte[] storeQR = {(byte)0x1d, (byte)0x28, (byte)0x6b, store_pL, store_pH, (byte)0x31, (byte)0x50, (byte)0x30};


    // QR Code: Print the symbol data in the symbol storage area
    // Hex      1D      28      6B      03      00      31      51      m
    // epson-biz.com - Epson
    byte[] printQR = {(byte)0x1d, (byte)0x28, (byte)0x6b, (byte)0x03, (byte)0x00, (byte)0x31, (byte)0x51, (byte)0x30};

    // flush() runs the print job and clears out the print buffer
    flush();

    // write() simply appends the data to the buffer
    write(modelQR);

    write(sizeQR);
    write(errorQR);
    write(storeQR);
    write(qrdata.getBytes());
    write(printQR);
    flush();
}
 
Last edited by a moderator:

borhane

Member
simply I want a qr code with an ascii code
like that :
Code:
chr(29)  + chr(40) + chr(107) + chr(3) +  chr(00) + chr(49) + chr(65) + chr(50) + chr(00) +
  chr(29) + chr(40) + chr(107) + chr(3) + chr(00) + chr(49) + chr(67) + chr(3) +
  chr(29) + chr(40) + chr(107) + chr(3) +  chr(00) + chr(49) + chr(69) + chr(48) +
  CHR(29) + chr(40) + chr(107) + CHR(3) + CHR(0) + chr(49) + chr(80) + chr(48) + "https://xxxxxxxxxxx.com/" +
  CHR(29) + chr(40) + chr(107) + chr(3) + chr(00) + chr(49) + chr(81) + chr(48) +
  chr(29) + chr(40) + chr(107) + chr(3) + chr(0) + chr(49) + chr(82) + chr(48) +
CHR(27) + CHR(64)+ CHR(47).
 
Last edited by a moderator:

TomBascom

Curmudgeon
Ok, you have figured out how to concatenate strings and use the CHR() function. You still need to figure out how to use CODE tags and how to show a meaningful amount of code.

None the less (I'm on a management conf call so I'm feeling generous):

[ c o d e ] (remove spaces)
Code:
output to value( "somefile" ).
put unformatted chr(29) + chr(40) + ... + chr(64) + chr(47).
output close.
[ / c o d e ] (remove spaces)

Is a minimal example that should do what you have asked for.
 
Top