Whitepapers Setting up a "localhost" printer with Print Wizard
What is a LOCALHOST printer?
Remote printer setup is like any other printer except that Windows sees it as connecting over a TCP/IP network via a network IP address, rather than directly connected. This is also referred to as an H/P JetDirect ® printer as it uses that same protocol and listens on the same network port for incoming print jobs as networked H/P printers.
“localhost” printing refers to passing something out over a network port and directing it back to your own PC, printing from one driver to another. This type of printer is sometimes necessary for certain Windows applications to correctly handle print jobs through a third party utility such as Print Wizard Server Edition.
“localhost” in this case refers to Windows passing a print job out the local TCP/IP port, targeted for itself. Think of it as printing remotely back to your own Windows PC.
When would I want to use it?
“localhost” printing may need to be used where a Windows application resides on a server or a local PC and uses the JetDirect ® protocol for printing. By setting up a local printer, you can force this method of printing to print to any local printer driver seen by the PC.
How do I set it up?
There are two parts to setting this up. The first is adding a printer for that remote port on your PC. The second is setting up some program, such as Print Wizard Server Edition’s “listen” service to watch for print jobs inbound.
The general setup involves installing a printer, setting its port to be a local TCP/IP port, running Print Wizard to listen for print jobs on that port and then setting the application up to print to that particular TCP/IP address and port.
We recommend using an H/P PCL printer driver for this and turning on “translatepcl” in Print Wizard to properly manipulate the print job.
Setting up a “localhost”printer
This is done through the “Printers And Faxes” icon in the Control Panel or the Start menu for your Windows system. Open up this option up and follow the steps below.
a) Select "Add a printer"

b) Click "Next"
c) Select "Local printer attached to this computer" and uncheck "Automatically detect...."

d) Click "Next"
e) In "Select a port", choose "Use the following port" and see if "localhost (Standard TCP/IP port)" is in the list. If so, use it. If not, choose "Create a new port" and select "Standard TCP/IP port".

f) Click "Next"

g) For Add Port, enter "localhost" for the printer name (port name should fill in and be the same).

h) Click "Next". There will be a delay while the wizard probes for "localhost" information.
i) Additional port information needs to be set for "Custom" and then select "Settings".

j) Make sure "Raw" is selected, that the port number is "9100" and that "SNMP status Enabled" is not checked.

Security issues:
On Windows Vista: Your "Printer Name or IP Address" may need to be set for 127.0.0.1 ( the IP equivalent of "localhost") or to the actual PC's IP address in order for this to work through Windows Vista security.
For other versions of Windows: As with Windows Vista, you may need to set the actual printer name or IP address to a specific network IP address. This depends on your DNS settings and any local host name files.
Port access: You must set the raw port number, 9100 by default, to allow INBOUND traffic through any firewalls, personal Internet security software or through your group and user policies.
Allowed Programs: Optionally, you can set add the Print Wizard's service program to the list of "allowed" programs for your specific security applications. For a Print Wizard stand-alone service the program is PWLISTEN.EXE, for a Print Wizard Windows Service it is PWSERVICES.EXE, both located in the default install directory for Print Wizard (usually under C:\Program Files\).
k) Click "OK".
l) Click "Next".
m) You should get the final status screen. Click "Finish".

n) This will return you to the select printer type screen.

Select your printer from the screen, click the “Windows Update” to let Windows install a default driver, or click the “Have Disk” if you are installing from disk.
o) Click “Next”.
p) Name your printer, but DO NOT make it your default printer, click “No”.

q) Click “Next”.
r) You do not need to make the printer shared as the Windows service for local TCP/IP printers will already have the printer shared. Simply click “Next”.

s) Next you would want to start Print Wizard in “listen” or running one of the Print Wizard “listen” services, waiting to receive a print job. Refer to the documentation below pertaining to setting up Print Wizard to work in “listen” mode, or see the Print Wizard manual for more information.
After Print Wizard has started, it may be advantageous to print a test page to insure you selected the correct printer driver for the attached printer. When done, click “Next”.

t) You will again receive the final printer status page. Simply click “Finish”.

The printer should be added to your list of printers and remote printing out to that printer should be allowed.
Setting up Print Wizard Listen
Next you will want something on your PC listening on that particular port, port 9100. This is where you would run the Print Wizard Server Edition in “listen” mode, listening for incoming print jobs.
To start Print Wizard Server Edition “listening” for incoming print jobs, you can start it from the Windows shortcut (see Start : Programs : Print Wizard : Print Wizard Listen). You can also run the Print Wizard application manually with the following command line switch (you can do this through the Windows Start : Run dialog, or through some third-party scripting).
We recommend using a PCL printer driver and then turning on the “translatepcl” option in Print Wizard to get the full advantage of printing using this method.
C:\”program files”\printwiz\printwiz.exe /listen /translatepcl /p”H/P Laserjet 5P”
Then from your application print to the LocalHost printer driver, i.e. “H/P Laserjet 5P Localhost”.
Conceptual Look at Print Wizard and Localhost Printing
It is important to understand what is going on here and it is more easily described in a diagram.
Print Wizard is being used here as a filter program, providing additional support and analysis that printer drivers cannot do, such as print overlays, labels, auto-fitting, auto-orientation, etc.
A PC application can print to a local printer driver attached to a localhost port. Print Wizard will then be listening for incoming data on that port and can massage the data prior to printing it. However, various other things can happen to the data depending on what format it is output in.
- If the application prints in “text mode”, the localhost printer driver will simply pass it out the port. Print Wizard will pick it up and pass it through its analysis process before handing it over to the Windows printer driver (driver #2).
- If the application prints in “graphics mode” and the localhost printer driver outputs in PCL, this data is passed on to Print Wizard. If Print Wizard has “translatepcl” turned on, the Windows printer driver is handed the data translated (text format). If Print Wizard does not have “translatepcl” turned on, then the print job is printed to the “spooler”, bypassing the Windows printer driver.
- If the application is printing in “graphics mode” and the localhost printer driver passes the data on to Print Wizard. If Print Wizard sees any printer-specific control or escape sequences, the data is printed to the “spooler”, bypassing the Windows printer driver.

There are other additional output possibilities from your application, such as PCL output. These are all handled in a similar method. The important thing to remember is there are two printer drivers involved, as well as Print Wizard. The type and capabilities of the printer driver must be compatible to interact properly.
For additional information, refer to the Print Wizard documentation.
|