0

printer : oki ml3320, emulation IBM I can't print this barcode...

Now I took 22. example from https://files.support.epson.com/pdf/general/escp2ref.pdf My last try looking that

final char[] x = {0x1B, 0x28, 0x42, 0x10, 0x00, 0x06, 0x02, 0x00, 0x7D, 0x00, 0x02, 0x42, 0x32, 0x33, 0x40, 0x61, 0x42, 0x63, 0x44, 0x5B, 0x5D};


    if (printer.getPrinterByName("OKI")){
        InputStream is = new ByteArrayInputStream(
                (new String(x)).getBytes(Charset.forName(DOSCharsetProvider.MAZOVIA_CHARSET_NAME)));

Result is printed " B4}B23@aBcDC] "

For example 1. : 3}012345678012

okey got it!

char[] b = "DWZ:3:1585543:5".toCharArray();
    final char[] start = {
            27,16,66,
            15, //length of code
            66 //CODE 128 mode B
    };

Last question... how Can I put a length of b to start (in 15 place)

KanekiSenpai
  • 122
  • 10
  • 2
    A bit of guessing: "[C@7b23ec81" ... that rather looks like something calls toString directly on an array of char! So, maybe you need Arrays.toString() somewhere. To get the content of a char array as string, not thatArray.toString()! – GhostCat Dec 03 '18 at 20:28
  • @GhostCat `Arrays.toString(char[])` will format the value as an array (`[1, 2, 3]`). To print a `char[]` as a string, use `new String(char[])` – Andreas Dec 03 '18 at 20:38
  • @Andreas Yeah... My tiredness forgot about something that I gave all the time, that is "new String()" but still have a problem updated post – KanekiSenpai Dec 03 '18 at 20:52

0 Answers0