Remote printing to a printer on another network

Using TCP/IP and lpr, you can print a file on a remote printer connected to a server on another network.

You just have to set up your QNX Neutrino network node for remote printing and the remote server for TCP/IP and handling printers compatible with lpr.

For instance, let's suppose you want to print /root/junk.ps, a PostScript file on a node on your QNX Neutrino network, but the only Postscript printer available (windows_printer) is connected to a Windows server with an IP address of 10.2.1.8.

First, make sure that the Windows server is configured for TCP/IP printing and that the printer is compatible with lpr. Then, as root, on your QNX Neutrino node:

  1. Add a printer description in /etc/printcap, like this:
    rlpt4:\
      :rm=windows_server:lp=:rp=windows_printer:\
      :sd=/usr/spool/output/lpd/rlpt4:
      
  2. Add a new line in /etc/hosts, like this:
    10.2.1.8      windows_server
      
  3. Create the spool directory:
    mkdir /usr/spool/output/lpd/rlpt4
      
  4. Start lpd.

To print a PostScript file on the printer, type:

lpr -Prlpt4 junk.ps