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

  1. Open Applications (Mac OS 9) -> Utilities -> Desktop Printer Utility.
  2. Select "Printer (LPR)" and click "OK".
  3. In the next window click "Change" for "LPR Printer Selection".
  4. Enter the IP address of the machine that will be acting as the LPR printer into the "Printer Address" field.
  5. Enter the name you wish to call the printer in the "Queue" field (no spaces).
  6. Click "OK".
  7. Click "Create..."
  8. Enter the name you wish to call the printer in the "Printer Name" field.
  9. Click "OK".
  10. Quit Desktop Printer Utility.

Mac OS X LPR Printer Configuration

  1. Open Applications -> Utilities -> Print Center.
  2. Click "Add Printer".
  3. Select "LPR Printers using IP" from the menu at the top of the pane.
  4. Enter the IP address of the machine that will be acting as the LPR printer into the "LPR Printerís Address" field.
  5. 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).
  6. Make sure "Printer Model" is set to "Generic".
  7. Click "Add".
  8. Quit Print Center.

Windows 2000 & XP LPR Printer Configuration

  1. Open the Control Panel through the Start Menu and open "Printers".
  2. Double click "Add Printer" (Windows XP just click the link).
  3. Click "Next".
  4. Select "Local Printer" and leave "Automatically detect and install my Plug and Play printer" check box unchecked.
  5. Click "Next".
  6. Select "Create a new port".
  7. 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.
  8. Click "Next" twice.
  9. Enter the IP address of the machine that will be acting as the LPR printer into the "Printer Name or IP Address" field.
  10. Enter the name you wish to call the printer in the "Port Name" field.
  11. Click "Next" and wait for a bit.
  12. Set "Device Type" to "Custom" and click "Settings".
  13. Set "Protocol" to "LPR".
  14. Enter the name you wish to call the printer in the "Queue Name" field (no spaces).
  15. Check the "LPR Byte Counting Enabled" check box.
  16. Click "OK", then click "Next", then click "Finish".
  17. Choose "Apple" -> "Apple Color LW 12/660 PS" and click "Next".
  18. If it tells you the driver is already installed, just click "Next" again.
  19. Enter the name you wish to call the printer in the "Printer Name" field.
  20. Click "Next" twice.
  21. Select "No" for "Do you want to print a test page?"
  22. 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:

  1. Run the server as root, which can be a security risk, or
  2. 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

  1. Edit the text file "/etc/inetd.conf" as root.
  2. Add the line "printer stream tcp nowait USER /usr/libexec/tcpd SPOOLER SERVER PORT" to the file where:
  1. Save the file.
  2. Reboot and run the LPR server.

Configuring inetd & Spooler on Linux Mandrake

  1. Create the text file "/etc/xinetd.d/printer" as root.
  2. 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
}
  1. Replace the following with:
  1. Save the file.
  2. Restart inetd with "/etc/rc.d/init.d/xinetd restart" and run the LPR server.