Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Well, that's easy to check out as long as you have a printer connected. It's going to depend on the printer. Doesn't work on my Brother laser printer on Linux, even if I send some valid Postscript to /dev/usb/lp0 . Piping it to lpr works of course, as long as you have a default printer selected.

Once you've established that you can print basic text, you can expect that the printer's escape codes will work.



Doesn't work on my Brother laser printer on Linux, even if I send some valid Postscript to /dev/usb/lp0

It's probably expecting ESC/P or PCL. Laser printers also usually wait for a formfeed before they will process a page.


Thanks. Adding a formfeed resulted in an empty page, so there are clearly possibilities but since I can't find a quick PCL example[0] and lpr suits me fine I'm not going to investigate further.

[0] I'm assuming PCL is most likely supported, and I remember having worked with an EPSON dot-matrix printer (i.e. probably using ESC/P) in 8-bit days and that it didn't require special commands to print basic text.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: