How to format font and text size on a thermal printer using Java

0

Well, I'm developing a program for a pizzeria and I need to print the orders with their respective pizza flavors, but with correct formatting, bigger letters and such, the default is too small for my needs, follow the code I'm using

import java.io.FileOutputStream;
import java.io.PrintStream;

public class Impressao {
    public static void main(String[] args) {
        FileOutputStream fos = null;
        PrintStream ps = null;
        try{ 
            fos = new FileOutputStream("LPT1:");
        } catch (Exception ex) {}
        try {
            ps = new PrintStream(fos);
        } 
        catch (Exception exception) {} 

        ps.print("Coloque aqui o que você quer");
    }
}
    
asked by anonymous 08.02.2017 / 15:23

1 answer

1

You need to read the printer documentation, to change the formatting, and the like in general, there are codes that should be sent to the printer. These codes may vary among the most different printers.

    
08.02.2017 / 16:51