How to Send ESC commands to a DOT MATRIX printer in Ruby on Rails?

Guys I need your help. I need to print RAW data to format the settings of the printer.

The below data are my example of RAW data...

! HELLO WORLD chr(27) + '!' + chr( 1) ! HELLO WORLD chr(27) + '!' + chr( 2) ! HELLO WORLD chr(27) + '!' + chr( 3) ! HELLO WORLD chr(27) + '!' + chr( 4) ! HELLO WORLD chr(27) + '!' + chr( 5) ! HELLO WORLD chr(27) + '!' + chr( 6) ! HELLO WORLD chr(27) + '!' + chr( 7) ! HELLO WORLD chr(27) + '!' + chr( 8) ! HELLO WORLD chr(27) + '!' + chr( 9) ! HELLO WORLD chr(27) + '!' + chr( 10) ! HELLO WORLD chr(27) + '!' + chr( 11) !HELLO WORLD chr(27) + '!' + chr( 12) ! HELLO WORLD chr(27) + '!' + chr( 13) ! HELLO WORLD chr(27) + '!' + chr( 14) ! HELLO WORLD chr(27) + '!' + chr( 15) ! HELLO WORLD chr(27) + '!' + chr( 16) ! HELLO WORLD chr(27) + '!' + chr( 17) ! HELLO WORLD chr(27) + '!' + chr( 18) ! HELLO WORLD chr(27) + '!' + chr( 19)

After I print this data the printer will ignore to print " ! " instead the printer will convert " ! " to format the Data ... the formatted output would be (font, and font size the printer will disregard ASCII which " ! " I mean the ASCII will convert to format the output of the printer ...

PLEASE HELP ME GUYS ... WE ARE CREATING REPORTS THAT WILL PRINT AND FORMAT USING DOT MATRIX PRINTER... THANKS IN ADVANCED

You don't mention whether this printer is connected to the Rails server, a client workstation, or the network.

If you're trying to print from Rails to anything other than the server, you're gonna have a hard time.

Hi Michael,

We will use a client workstation.

Thanks for the response.