ESC/POS Cant use Raw Commands

Hi, me again, i’m having troubles with my Thermal Printer
It’s ESC/POS format
I’m trying to use Printer Commands, but it just print them and it’s not changing formats

i hope u cant help me with this as always

Have a nice day!

Please share which printer ? and commands?

Thanks for replying its a dinom tm-t80

I’ve usted Many escpos commands but maybe i wasn’t inserting them correctly, i need to do some tables, bolso And italic, And a qr code

show me the code

can i have your prn file?

Where can i find it?

Let me make thing simple , whenever you send commands raw commands to printer you always test it using by creating prn file , in which you put a code to debug and then send it to printer, I have been using thermal printers for many things, and all companies, which software you used to test or generate code?
can i see the raw commands?

I felt so frustrated yesterday about it, so i deleted all raw commands because i tried diferent ways

Didn’t know about prn files, could u talk me more about it please

yes sure , community helps each other, first i am really interested in knowing the details ,

  1. how you designed? or wrote the raw commands?
  2. what was the core issue coming ? printer was not printing? or giving error ? what was happening basically?

1 i tried many ways, but maybe i didn’t know the correct syntaxis
2 Printer was Printing with no errors, it just printed the commands as text

Oh yes got it ! let me fix it for you give me data you want to print

Hello Team,

Happened the same to me. All commands are printed as text instead of command.

Enable Raw Print is checked.

Beverly Hills, CA  90210\x0A

Just an example.



Any Update

My resolution was to print directly to the printer.

I couldn’t find a way by using Raw Print Format unless you have access to source code.

I did everything with Javascript.

This was something I did, but I haven’t tested extensively.

bixolon.commands = {
    // Const
    init: () => ['\x1B' + '\x40', '\x1B' + '\x52', '\x12'],
    center_align: () => '\x1B' + '\x61' + '\x31',
    center_line: function(str) { return this.center_align() + str + + this.left_align() },
    standard_font_size: () => '\x1D' + '\x21' + '\x00',
    left_align: () => '\x1B' + '\x61' + '\x30',
    right_align: () => '\x1B' + '\x61' + '\x32',
    bold_on: () => '\x1B' + '\x45' + '\x0D',
    bold_off: () => '\x1B' + '\x45' + '\x0A',
    cut: () => bixolon.commands.n.repeat(5) + '\x1B' + '\x69',
    bold: (str) => '\x1B' + '\x45' + '\x01' + str + '\x1B' + '\x45' + '\x00',
    n: '\x0A',
    br: (breaks=1) => bixolon.commands.n.repeat(breaks),
    p: (str) => str + bixolon.commands.n,
    double_strike_on: '\x1b'+'\x47'+'\x01',
    double_strike_off: '\x1b'+'\x47'+'\x00',
    double_strike: function(str) { return this.double_strike_on + str + this.double_strike_off},
    feed: function(lines) { return '\x1b' + '\x64' + String.fromCharCode(lines) },
    feed1cm: () => '\x1b' + '\x4a' + '\x8E',
    fontB: () => '\x1B' + '\x4D' + '\x00',
    fontA: () => '\x1B' + '\x4D' + '\x01',
    text2h: (str) => '\x1b' + '\x21' + '\x10' + str + '\x1b' + '\x21' + '\x00',
    text2h_em: (str) => '\x1b' + '\x21' + '\x18' + str + '\x1b' + '\x21' + '\x00',
    text2w: (str) => '\x1b' + '\x21' + '\x20' + str + '\x1b' + '\x21' + '\x00',
    text2w_em: (str) => '\x1b' + '\x21' + '\x28' + str + '\x1b' + '\x21' + '\x00',
    text4sq: (str) => '\x1b' + '\x21' + '\x30' + str + '\x1b' + '\x21' + '\x00',
    set_default: () => '\x1b' + '\x21' + '\x00',
    em: function(str) { return text4sq(str); },
    text4sqbold: (str) => '\x1b' + '\x21' + '\x38' + str + '\x1b' + '\x21' + '\x00',
    division: function(char="=") { return char.repeat(this.MAX_DEFAULT_CHARS) },
    // Pre-defined Format Functions
    section: function(title) { return this.feed(1) + this.center_align() + this.text2w(title) + + this.left_align() },
    doc_header: function(title) { return this.center_line(this.text4sqbold(title)) + this.division() },
    kv: function(title, value, truncate=true) { 
        let _title = title + ' :';
        let left_chars = this.MAX_DEFAULT_CHARS - _title.length;
        let truncated_value = value.substring(0, left_chars)
        return title + ': ' + this.bold((truncate ? truncated_value : value)) +;

Can anyone guide or direct me in designing a Print Format for ESC/POS Print

yes @Sai_Nath_Ravipati please ask but with printer model

Epson LQ-50 Dot Matrix Printer - ESC/P 2

Hi @Muzzammil_Hussain ,
we use sunmi v2 devices which is an android device with an integrated thermal printer.

I appreciate any guidance in this regards, I need to print directly to the printer without the print preview page.

thanks in advanced

is this issue solved or still need help?

hi @Muzzammil_Hussain ,

still didn’t work as needed, we added “SunmiPrinterPlugin” from the Sunmi store to reach the printer, its working now but we couldn’t bypass the print preview screen.

thanks for your help and concern I appreciate it.