I'm trying to print on a printer POS for tickets. It's a EPSON TMU220PD. I can print, but I don't know how I can program printer for print with a font bigger and how I can to do for cut the paper automatically. I have reading a lot and there are page where they say I can to use commands ESC/POS but I don't have idea to how work this. I hava a man class with the next code:
public static void main(String[] args) {
JavaApplication14 java = new JavaApplication14();
try {
FileWriter file = new FileWriter("/dev/usb/lp2");
BufferedWriter buffer = new BufferedWriter(file);
PrintWriter ps = new PrintWriter(buffer);
java.setFormato(5, ps);
java.cortar(ps);
}
And method for "cut" is this
private void cortar(PrintWriter ps) {
try {
char[] ESC_CUT_PAPER = new char[]{0x1B, 'm'};
ps.write(ESC_CUT_PAPER);
} catch (Exception e) {
System.out.print(e);
}
}
When I'm going to print, printer work normally to print text, but It not cut the paper. I need increase the text size too, but I don't know how I can to do It and How I can use commands ESC/POS on java.