I'm programming a password calling system, and I'm having trouble to print the callsign. Basically it's supposed to print a String like "C1234", but it only prints the "C" whithout the following numbers.
Already tried messing with the DocFlavor and InputStream Types, however every time it prints the problem repeats itself.
This is the printing function.
public void PrintSenha()
{
String impressora = PrintServiceLookup.lookupDefaultPrintService().getName();
System.out.println("Default Printer: "+impressora);
PrintService servico = PrintServiceLookup.lookupDefaultPrintService();
String senha = "C2450";
byte[] dados;
try {
dados = senha.getBytes();
PrintRequestAttributeSet pras = new HashPrintRequestAttributeSet();
pras.add(new Copies(1));
DocFlavor flavor = DocFlavor.BYTE_ARRAY.AUTOSENSE;
Doc doc = new SimpleDoc(dados, flavor, null);
DocPrintJob job = servico.createPrintJob();
job.print(doc, pras);
} catch (PrintException ex) {
Logger.getLogger(Operacoes.class.getName()).log(Level.SEVERE, null, ex);
System.err.print("Print Exception"+ex.getMessage());
}
}