/*exported Printer */ function Printer() { var _printer = null; return { putChar: function(val) { if (!_printer || _printer.closed) { _printer = window.open('', '_blank','toolbar=0,location=0'); if (_printer) { _printer.document.title = 'Printer'; _printer.document.write('
'); _printer.document.write(''); window.focus(); } } if (_printer) { var c = String.fromCharCode(val & 0x7f); if (c == '\r') { _printer.document.write('
'); } else if (c == ' ') { _printer.document.write(' '); } else { _printer.document.write(c); } } } }; }