Sorry guys, I was posting snippet of my codes here without giving proper context information, etc.
@J-G, sending only #27'@' did the trick. I thought it wouldn't work because that's what I basically send the the printer right before I start a new printing job, I send the @ ESC code to make sure the printer is initialized. This works fine under windows, however here in Linux it's requiring this extra initialization process.
It's true, the extra line is not necessary, I can just simply write to the printer. But I use the printer_text variable for some other purpose in my printing method, I just copy/pasted my old procedure and used it here.
@rvk, sorry for not providing a sample project. I didn't do it because I wouldn't be able to reproduce the printing outside of my environment. I actually fetch the text to print from a remote server, it comes with all the required ESC codes for formatting, so it'd be too complex to replicate it. Sorry for not stating it before.