LPR Network Printing
Copyright © MultiAd, Inc., 2002 - 2007
This document describes Creator Server's and Document Master's
ability to function as a network printer using the LPR (Line Printer Remote)
protocol and how to configure and use it.
Basics
LPR is a TCP/IP printing protocol that is supported by Mac
OS 9, Mac OS X, Windows, and UNIX environments. The basic function of LPR
is to take a PostScript printing job and hand it to the printer, but our
implementation takes the PostScript file and saves it to a directory. The
directory of .ps files may then be used for further processing. The .ps files
are named after their print jobs, so printing "untitled.txt"
would result in "untitled.ps".
Mac OS 9 LPR Printer Configuration
- Open Applications (Mac OS 9) -> Utilities -> Desktop Printer Utility.
- Select "Printer (LPR)" and click "OK".
- In the next window click "Change" for "LPR Printer Selection".
- Enter the IP address of the machine that will be acting as the LPR printer into the "Printer Address" field.
- Enter the name you wish to call the printer in the "Queue" field (no spaces).
- Click "OK".
- Click "Create..."
- Enter the name you wish to call the printer in the "Printer Name" field.
- Click "OK".
- Quit Desktop Printer Utility.
Mac OS X LPR Printer Configuration
- Open Applications -> Utilities -> Print Center.
- Click "Add Printer".
- Select "LPR Printers using IP" from the menu at the top of the pane.
- Enter the IP address of the machine that will be acting as the LPR printer into the "LPR Printer’s Address" field.
- Uncheck the "Use Default Queue on Server" checkbox and enter the name you wish to call the printer in the "Queue Name" field (no spaces).
- Make sure "Printer Model" is set to "Generic".
- Click "Add".
- Quit Print Center.
Windows 2000 & XP LPR Printer Configuration
- Open the Control Panel through the Start Menu and open "Printers".
- Double click "Add Printer" (Windows XP just click the link).
- Click "Next".
- Select "Local Printer" and leave "Automatically detect and install my Plug and Play printer"
check box unchecked.
- Click "Next".
- Select "Create a new port".
- Choose "Standard TCP/IP Port" from the "Type" drop down menu. You may have to scroll all the
way down, it’s usually at the bottom.
- Click "Next" twice.
- Enter the IP address of the machine that will be acting as the LPR printer into the "Printer Name or IP Address" field.
- Enter the name you wish to call the printer in the "Port Name" field.
- Click "Next" and wait for a bit.
- Set "Device Type" to "Custom" and click "Settings".
- Set "Protocol" to "LPR".
- Enter the name you wish to call the printer in the "Queue Name" field (no spaces).
- Check the "LPR Byte Counting Enabled" check box.
- Click "OK", then click "Next", then click "Finish".
- Choose "Apple" -> "Apple Color LW 12/660 PS" and click "Next".
- If it tells you the driver is already installed, just click "Next" again.
- Enter the name you wish to call the printer in the "Printer Name" field.
- Click "Next" twice.
- Select "No" for "Do you want to print a test page?"
- Click "Next" and then click "Finish".
Running the LPR Server
The easiest way is to edit the preferences file and run it
on port 515, the RFC standard port for LPR printers. However, Windows and UNIX
restrict access to low numbered ports (including 515) so that only users with
administrator or root access may use them. This leaves you with two options:
- Run the server as root, which can be a security risk, or
- setup port forwarding to send connections on 515 to an unrestricted port.
Port forwarding allows you to run the server as a normal
user which is much safer than running the server as root but it is also
somewhat more difficult to set up.
Running the LPR Server as Root
To run the server as root simply edit the preferences to
turn on LPR using port 515. On a UNIX-based OS, use the "su" command to change
to super user and run the LPR server. Configuring Creator Server or Document
Master as daemon processes on UNIX also runs it as root by default.
Running the LPR Server with Port Forwarding
Edit the preferences to make the LPR server listen on an
unused and unrestricted port (example: port 4001). If you already know how to
make the operating system port forward 515 to 4001 then you're all set, just do
that and run the LPR server. Otherwise you can use inetd & Spooler to
forward connections. Spooler is a tiny helper application located in "Resources"
that sends printing requests to the LPR server while it’s running. You have to
setup inetd to run the Spooler every time a connection is received on port 515.
When this is setup correctly inetd listens on the restricted port for you, so
you are no longer required to run anything as root. Below are some instructions
on setting this system up on various operating systems:
Configuring inetd & Spooler on Mac OS X
- Edit the text file "/etc/inetd.conf" as root.
- Add the line "printer stream tcp nowait USER /usr/libexec/tcpd SPOOLER SERVER PORT" to
the file where:
- USER is what user to run the Spooler binary as.
- SPOOLER is the full path to the Resources/Spooler binary.
- SERVER is the address of the server (same machine is 127.0.0.1).
- PORT is the port the server is accepting LPR connections on.
- Save the file.
- Reboot and run the LPR server.
Configuring inetd & Spooler on Linux Mandrake
- Create the text file "/etc/xinetd.d/printer" as root.
- Enter this into the file’s contents:
#description: use LPR printing with CreatorServer/DocMaster
service printer
{
socket_type = stream
protocol = tcp
wait = no
user = USER
server = SPOOLER
server_args = SERVER PORT
disable = no
only_from = 0.0.0.0
}
- Replace the following with:
- USER is what user to run the Spooler binary as.
- SPOOLER is the full path to the Resources/Spooler binary.
- SERVER is the address of the server (same machine is 127.0.0.1).
- PORT is the port the server is accepting LPR connections on.
- Save the file.
- Restart inetd with "/etc/rc.d/init.d/xinetd restart" and run the LPR server.