Follow

Serious question

I have a network printer
I have a command line only computer running
I want to print a text file

The printer has lpd on port 515, ipp on 631, and jetdirect on 9100

How do?
Do I need cups?

So I've ended up installing CUPS, and it Just Works (almost).

CUPS found my network printer immediately, which was a good start.

I then created a basic scipt to make it easier to print files, and saved it as /user/local/bin/doPrint, which means anyone can do
$ doPrint filetoprint

All it really does in munge the commands together:

enscript -p - $1 | lp -o media=A4 -o sides=two-sided-long-edge -d Brother_HL_L2360D_series

Show thread

@M0YNG I’m sure either lpd or jetdirect that I’ve just piped postscript into with netcat and it worked. Make postscript with enscript.

@irl hmm, half worked.

I piped enscript into netcat and the printer spit out two lines of postscript stuff and 4 blank pages

@M0YNG hmm printers are hard :blobshrug:

it may have been the jetdirect card i was using had some compatibility mode or something i was using

@M0YNG of course I would install cups and the printer driver through cups web interface

@M0YNG You can probably just use CUPS's lp or lpr command and ditch enscript since those two will interpret Postscript themselves.

The catch here is making sure you use CUPS's lp or lpr and not that of some other printing system. Which one gets used depends on which one is in a directory that's found first in your PATH variable. If your path is "/usr/bin:/usr/local/bin" and there's 2 lp commands, one in each directory, then the one in /usr/bin will get used.

@ND3JR ah, I did successfully print directly from a text file, but the font was large.
Via postscript it was fine.

Will have to check which version of lp I used.

Sign in to participate in the conversation
Mastodon.Radio

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!