In this section, we'll consider printing to and from Windows systems.
13.5.1 Printing to a Windows Printer from a Unix System
Like most System V-based Unix operating systems, Windows NT and Windows 2000 systems provide an LPD service to handle incoming remote print jobs from non-Windows systems. The queues on the client Unix systems can be set up as normal for outgoing printing to a remote LPD server (as discussed earlier in this chapter). On the Windows server, you will need to do the following:
Figure 13-7. Modifying the Windows 2000 LPD service
13.5.2 Accepting Incoming Windows Print Jobs via Samba
The Samba facility can be used to make Unix printers visible to Windows clients as normal shared printers (for Samba basics, see Section 10.4).
Sharing a printer can be accomplished in two ways: by creating a share entry for a specific printer or by sharing all of theprinters within a printcap file. Here is a Samba configuration file entry corresponding to the first approach. It creates a share named laser4:
[laser4] printable = yes Entry is a printer. comment = LW on dalton Browse description. public = yes postscript = yes Jobs will send PostScript files. printer name = laz4 Local printer queue name. printer driver = Windows-name Official Windows designation
The final field specifies the driver to be used on the Windows system when printing to this printer. It must be set to the string that appears in the Add Printer Wizard's printer selection dialog's Printers list, in other words, the descriptive name by which Microsoft refers to it (e.g., "Apple LaserWriter II NTX-J v50.5"). This field does not hold the path to the driver file.
If you want to store the printer driver files locally (rather than requiring them to be on the Windows system), you can use the printer driver location setting as well and set up a local share to hold them. This technique is discussed in detail in the Network Printing book cited earlier.
Here are some sample entries that illustrate the second approach to sharing printers with Samba:
[global] Add these to the global section. load printers = yes Share all printers in the printcap file. printcap name = /usr/local/samba/lib/printcap printing = bsd|sysv|aix|hpux|lprng Specify local print spooler type. [printers] One entry for all printers. comment = Exported printers path = /var/spool/smb-print printable = yes guest ok = yes guest account = samba auto services = david monet Browseable printers.
This approach requires specifying several settings with the global section of the Samba configuration file. In this example, they direct the Samba system to create shares for all of the printers listed in the designated printcap file and also specify the spooling system in use on the local system.
The printers entry completes the process of sharing printers. Our example specifies a path used for scratch space and a list of printers to appear in browse lists.
Two observations are worth making at this point:
22.214.171.124 Creating queues for the Samba printers under Windows
On the Windows system, you must create a queue for such remote printers, using the Add Printer wizard as usual. Specify the printer type as local (not remote), and then create an LPR port for it (if one doesn't already exist); select New Port, provide a port name, and then choose the LPR port type (illustrated in Figure 13-8). Then enter the name of the remote system and printer into the resulting dialog, and go on to complete the remainder of the Add Printer process as normal.
Figure 13-8. Creating an LPR port under Windows 2000
On Windows NT 4 systems, there can be occasional problems where PostScript or PCL files are printed as text rather than having their instructions interpreted by the printers as a program to be run. This happens because the job has somehow been marked as text data rather than as raw data.
You can configure the printer to treat all jobs as raw data by accessing its Properties and then choosing the Advanced tab and then the Print Processor button. In the resulting dialog, choose the RAW setting (illustrated in Figure 13-9).
Figure 13-9. Forcing a printer into raw mode operation
You can make this setting apply to the print spooler as a whole by setting the HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LPDSVC\Parameters\SimulatePassThrough registry key to 1 .