rendered paste body public static void setReadyMessage(String host, int port, String message) { String esc = String.valueOf( (char) 27 ); String send = esc + "%-12345X@PJL JOB\n" + "@PJL RDYMSG DISPLAY=\""+message+"\"\n" + "@PJL EOJ\n" + esc + "%-12345X" + esc + "E"; try { Socket printer = new Socket( host, port ); PrintWriter out = new PrintWriter( printer.getOutputStream(), true); out.print(send); out.flush(); printer.close(); } catch (Exception e) { System.out.println("Failed to send to " + host); } }