Hacker News new | ask | show | jobs
by gpvos 623 days ago
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.

1 comments

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.