Dot Matrix BOLD Printing in Java -
i have written program send raw (text only) data printer dot matrix printer have print provided texts instead of interpreting input image(which makes huge time finish). dot matrix printer installed generic text printer in control panel.
printer - wep 800 dx http://www.wepindia.com/support/support.aspx?itemcode=mfd-0380
printservice service = //my dot matrix print service string input = "esc e bold esc f printing\n"; inputstream stream = new bytearrayinputstream((input.getbytes(charset.defaultcharset())); doc doc = new simpledoc(stream, docflavor.input_stream.autosense, null); docprintjob job = service.createprintjob(); try { job.print(doc, null); } catch (printexception e) { e.printstacktrace(); } // codes // esc e - turn bold printing on // esc f - turn bold printing off
i list of codes from
http://www.lprng.com/distrib/resources/ppd/epson.htm
http://webpages.charter.net/dperr/links/esc_p83.htm
the reason why codes epson because somewhere read these implemented of other manufacturers , cant seem find printer manual printer in manufacturer's website.
but when run program, command codes esc e
, esc f
printed in paper instead of interpreting command codes.
maybe i'm sending command codes in wrong format. appreciated.
update - got working, @user2357112
char[] bold = {0x001b, 0x0045}; // esc, e char[] unbold = {0x001b, 0x0046}; // esc, f string input = new string(bold) + " bold " + new string(unbold) + " printing\n";
output - bold printing
Comments
Post a Comment