linux print directly to network printer that IS NOT installed

Try this:

cat you_file.prn | netcat -w 1 printer_ip 9100

If using bash then:

cat /path/to/file > /dev/tcp/10.11.234.75/9100

What you want to do is probably not feasible. If the printers at the ends of these IP addresses are just random printers, then the server you're building would need to know which driver to use to be able to print to them. If you haven't installed them in any way beforehand then it's not going to work.

If you only want to talk to other Internet Printing Protocol (IPP) servers then it is possible, although not necessarily elegant. I don't know of any other Linux implementations of an IPP client than CUPS, and CUPS requires you to install printers in advance. This can be done very easily though (as explained here). It's the same code to add a normal printer (but you need to know which driver to use) as for an IPP server. Alternatively, you might be able to find another IPP implementation (or write one - it should be fairly simple just to send a document) which doesn't require installing printers.

Here's the code to add an IPP printer to CUPS:

lpadmin -E -p <printer-name> -v http://<ip_address>:631/<dir>/<printer> -L <location> -E

<printer-name> and <location> can be whatever you like, and you need the full network path to the printer.

To add a normal printer:

lpadmin -E -p <printer-name> -v <device-uri> -m <model> -L <location> -E

This is the same, except that you need to give a <model>, which is the driver for the printer. Scrap the first -E if you don't want encryption.

If you want to delete the printer afterwards, use this:

lpadmin -x <printer-name>

Tags:

Linux

Printing