How to run a test of lpdspooler.

This walk through will give a user an understanding of how to run the lpdspooler.  It will also show how to setup a printer (in Windows 2000) to print to the lpdspooler and how to setup a printer (in RedHat Linux 9.0) to print to the lpdspooler.  Of course the point of the lpdspooler is to capture print jobs so that you (the programmer) can do something with the print jobs before printing them.  Some uses I have had are:

Running lpdspooler

  1. Download the latest release of lpdspooler from sourceforge project site
  2. Extract release contents to a directory of your choice which we will call lpd_direcotry.
  3. Add the "log4j" JAR (found in the lpd_direcotry/lib directory) and "lpd" JAR (found in the lpd_direcotry/dist/lib) directory to your CLASSPATH
  4. Run "java org.simoes.lpd.Main" from the directory where you extracted lpdspooler (the lpd_direcotry).  This is important because lpdspooler looks for the 2 configuration files "logConfig.ini" and "".  The default setting in these files should be fine.
  5. For me on Windows my command line looks like this below all on one line, again be sure to run from your lpd_directory:
  6.     C:\Chris\Java\Projects\lpd-0.5.4>java -classpath "C:\Chris\Java\Projects\lpd-0.5.4\lib\log4j-1.2.8.jar;C:\Chris\Java\Projects\lpd-0.5.4\dist\lib\lpd-20031206.jar" org.simoes.lpd.Main
  7. Install a printer to print to the lpdspooler.

Installing a printer to print to the lpdspooler (Windows 2000)

Begin by clicking on the "Add Printer" wizard.  Since a picture is worth a thousand words, these should show you what you need to do.

Click "Add Printer"

Choose Local printer, do not automatically try to detect it.
Choose "Local Printer"

Create a new Standard TCP/IP port.
Create a new port of type Standard TCP/IP

This will launch the Add Standard TCP/IP Printer Port Wizard.
Add a new port

Enter the IP of the box running lpdspooler, just use the loopback IP for your box
Enter the IP of the box running lpdspooler, for this example use the local box

Choose Custom and click on the settings button.
Setup custom settings for the port

Configure the protocol for LPR printing, the Queue name to RAW.
Configure port settings for LPR printing, the Queue name to RAW

Click Finish to add the port, and then for this example just add a Generic Text printer.
You can use any printer type you like in practice.
For this example just add a Generic Text printer

Might as well keep the existing driver, but it really should not matter.
Choose if you want to keep the existing driver or not.

Name your printer something and choose if it will be the default printer or not.
Give the printer a name

Choose if you want to share this printer.
Choose if you want to share the printer.

Choose to not print a test page.
Choose not to print a test page

Click finish.
Click finish and you are done.

Now if you open up a document in Notepad you should be able to print to the printer you just created.  These print jobs should show up in the lpdspooler. 

Print to the lpdspooler in Linux (RedHat 9.0)

The following shows how to setup a print queue using RedHat Linux 9.0.  However, the only really important piece here is that you setup your LPD print queue with the correct IP and QUEUE name.  To be even handed pictures follow:

Click New in the Printer configuration
Start Add printer wizard

Click Forward
Start configuring printer

Enter a Name here to identify this printer on the Linux box (can be anything).
Enter a name for this printer

Select "Networked UNIX (LPD)" as the queue type.
For our example set the server to and the Queue to RAW.
Enter the proper IP and Queue

Choose the Raw Print Queue printer model.
Choose a printer model

Click Finish.
Click finish

Now if you send a print job to this printer, it should show up in the lpdspooler.  You can either use a text editor with your version of linux, or the command: "lpr -P LPR_PRINTER testFile.txt" worked for me.

Back to home page.