0

I want to use print product information on label printer. I have Zebra TLP 2844 This printer support EPL2 programming language. When I want to print non-ASCII character printer just print "?" instead of the correct character. What I did? First I created a simple text file with the below content

əğüçşıö

and press CTRL+P to print. Output is ok printer print all characters normally.

But when I use EPL2 commands like below

N
A220,120,0,4,1,1,N,"əğçşıüö"
P1

My printer gives the below output

??ç??üö

How can I solve this problem? I use java print api to send command to my printer. And this my code

PrinterJob pj = PrinterJob.createPrinterJob();
Doc doc = new SimpleDoc(sb.toString().getBytes(), DocFlavor.BYTE_ARRAY.AUTOSENSE, null);

boolean result = false;
javax.print.PrintService printService = PrintServiceLookup.lookupPrintServices(null, null)[0];
try {
    printService.createPrintJob().print(doc, null);
} catch (PrintException e) {
    e.printStackTrace();
}
PrinterJob pj = PrinterJob.createPrinterJob();
Doc doc = new SimpleDoc(sb.toString().getBytes(), DocFlavor.BYTE_ARRAY.AUTOSENSE, null);

boolean result = false;
javax.print.PrintService printService = PrintServiceLookup.lookupPrintServices(null, null)[0];
try {
   printService.createPrintJob().print(doc, null);
} catch (PrintException e) {
   e.printStackTrace();
}
Delphi Coder
  • 1,723
  • 1
  • 14
  • 25
sancho
  • 598
  • 2
  • 8
  • 22

1 Answers1

0

Its not an issue with the code it's an issue with the printer. Most printers don't include those characters in their standard font set. You either need to use the character's hex to call them or, if they're not included on the font set on the printer, download a different font.

person
  • 458
  • 3
  • 16