class PrintJobForRawCommands extends React.Component { constructor(props) { super(props); this.state = { printerCommands: "" }; } setPrinterCommands(cmds) { //console.log(cmds); //no need to re-render this.state.printerCommands = cmds; this.props.onPrinterCommandsChange(this.state.printerCommands); } setPredefinedCommands(cmdId){ let cmds = ''; if(cmdId == 'zpl') cmds = '^XA^FO30,40^ADN,36,20^FDZPL Printed from JSPrintManager^FS^FO30,60^BY4^B3N,,200^FD12345678^FS^XZ'; else if(cmdId == 'epl') cmds = '\x0AN\x0AQ609,24\x0Aq784\x0AA170,5,0,1,5,5,N,"EPL Printed from JSPrintManager"\x0AB170,50,0,3C,2,6,120,B,"BCP-1234"\x0AP1\x0A'; else if(cmdId == 'escpos') cmds = '\x1b@\x1bE\x01ESC POS Printed from JSPrintManager\x1bd\x01\x1dk\x04987654321\x00\x1bd\x01987654321\x1dV\x41\x03'; else if(cmdId == 'ipl') cmds = 'CPE4;F4H0;o200,100;f0;c25;h20;w20;d0,30L1;o200,150;f0;l575;w5B2;o200,200;c0,0;h100;w2;i1;d0,10I2;h1;w1;c20RE4IPL Printed from JSPrintManagerSAMPLE'; else if(cmdId == 'dpl') cmds = '\x02L\x0dH07\x0dD11\x0d191100801000025DPL Printed from JSPrintManager\x0d1a6210000000050590PCS\x0dE\x0d'; document.getElementById("cmds-" + this.props.jobIndex).value = cmds; this.setPrinterCommands(cmds); } render() { return (

Enter the raw printer commands
Enter the printer's commands you want to send and is supported by the specified printer (e.g. ESC/POS, ZPL, EPL, etc).
For non-printable characters, use the JS hex notation (e.g. \x0D for carriage return, \x1B for ESC)
Refer to your target printer programming manual to know how to write the raw commands!
Predefined Samples for most known RAW Printer Commands