[NeXTanswers Logo] [Index] [Download] ---------------------------------------------------------------------------- Search NeXTanswers for: ---------------------------------------------------------------------------- printing with PostScript devices feature by Andrew Simms with special thanks to Amir Gharaat You awaken in a dark room. There are boxes, manuals, and cables strewn about. There is a printer with a screwdriver driven into the heart of the printing mechanism. The police are breaking through the door. You realize that this is your office and you must have passed out. There is a loud crash as the printer leaps on your face .... Printer configuration doesn't have to be a nightmare. This article serves as a guide to existing methods of attaching a PostScript(R) output device to your network and configuring your NeXT(TM) computers to use it. If you're only attaching NeXT printers, you don't need to read this article. Information on installing NeXT printers is covered in the NeXT User's Reference and Network and System Administration manuals. If you have successfully attached a PostScript output device to a NeXT computer and would like to see the process outlined in a future edition of the support bulletin, please see the submission guidelines at the end of the article. connections for output devices There are two primary means of attaching an output device to a NeXT computer: direct attachment (for example, via a serial cable) and network connection (for example, via EtherTalk(R)). Direct attachment is typically simple, inexpensive, and slow, and the physical distance between the NeXT computer and the output device is limited by the length of the cable. Network connection is generally complex, fast, and expensive, and there are few distance limitations. The path you choose must be determined by your budget, your output device, your users, and of course, your patience. Table 1 illustrates the relative speeds for each type of connection. The times listed reflect the approximate numbers of seconds for a test file of 48,177 bytes (a typical number for a page of text) to be transmitted to an output device, assuming an ideal connection and no buffer overruns. table 1: transmission times by connection type connection speed 9600 baud serial cable 46 seconds 38400 baud serial cable 10 seconds LocalTalk(R) network 6 seconds Ethernet < 2 seconds These figures should be used only for comparing relative speeds of each connection type. There are many other factors that influence the time it takes to actually print a page, such as printer processor speed. configuration fundamentals All remote printing and printing to non-NeXT local printers on NeXT computers is accomplished through the Berkeley spooling system, more commonly referred to as lpd spooling. The name lpd comes from the Line Printer Daemon program, which accepts print requests and dispatches them to the appropriate printer. The lpd program accepts print requests in a special format, which is typically generated by the lpr program. The lpd system relies on a database of printers called the printcap printer capability database. All PostScript output devices must be described in printcap before they can be recognized and used by application programs. On the NeXT computer, this information is stored in NetInfo(TM). Information about a single printer in the printcap database is typically called a printcap entry. A given entry contains various pieces of information about a printer but will always contain these three items: * Name (and possibly aliases) of the printer * Location of the printer * Location of the spool directory The name of the printer, as listed in printcap, is how it will be referred to in the Print panel of applications. The location of the printer determines if it is locally or remotely attached. The spool directory indicates where print jobs are stored after a print request is issued but before the output appears at the device. Each printer you want to use must have a printcap entry in order to be recognized by applications. Printer names must be unique. network connection strategies You must address several issues before you begin configuration, such as which printers will be made available to the network and which NeXT machines will access the printers. You should work out these administrative issues in advance and write them down. At this time, NeXT supports only one network connection paradigm-a printer attached to a remote UNIX(R) host. With the purchase of additional hardware, you can expand this model to include printing to different types of networks, such as EtherTalk. The Cayman Systems GatorBox(R) is one such device, and, as of this printing, the only "one-stop" solution. Before performing any of the procedures explained in the following sections, please read all the instructions in the appropriate section. Unless otherwise specified, perform all commands as root. setting up for general remote printing The instructions in this section apply when the remote print server is a non-NeXT computer that runs a Berkeley-compatible remote spooling system (exporting a printer from a NeXT host is described in the Network and System Administration manual). You'll also need to be running Release 2.1 or have the 2.0 lpr patch installed. You may need to consult the manuals for the print server's spooling system. NeXT strongly recommends that you coordinate with the system administrator of the print server before configuring your machine to use the remote printer. 1. Determine the host name of the remote host. 2. Test connectivity to the remote host using ping. The following simple test verifies that the host name is valid and is reachable. For more information, see the UNIX manual page for ping(8). Enter ping -v remotehost 64 1 and you should get a response like PING remotehost: 64 data bytes 72 bytes from 111.18.10.220: icmp_seq=0. time=30. ms ----remotehost PING Statistics---- 1 packets transmitted, 1 packets received, 0% packet loss round-trip (ms) min/avg/max = 30/30/30 3. Determine the local name of the remote printer. You may have to ask the system administrator of the remote machine. 4. Set appropriate permissions. This usually involves placing the host name of your NeXT computer in the /etc/hosts.lpd flat file of the remote machine. 5. Build a remote printcap entry in a temporary file on your NeXT computer. You can use the following (or the example at the end of the /etc/printcap flat file) for a model: netnp:\ :lp=:rm=remotehost:rp=remotename:\ :sd=/usr/spool/netnp:\ :ty=some printer: You'll need to replace remotehost with the name of the remote machine and remotename with the remote machine's local printer name. The string following ty= is a free-format description that will appear in Print panels. 6. Load the printcap entry into the appropriate NetInfo domain. The following example shows the entry being loaded in the local domain. Replace filename with the name of the printcap file created in the previous step: niload printcap . < filename On a multilevel network, you need to evaluate what machines should see the printer and choose a domain appropriately. 7. Enter nidump printcap . The system will display output like that shown below. Check it to verify that the entry was loaded correctly. Local_Printer: \ :if=/usr/lib/NextPrinter/npcomm:\ :gf=/usr/lib/NextPrinter/psgf:\ :nf=/usr/lib/NextPrinter/psnf:\ :tf=/usr/lib/NextPrinter/pstf:\ :rf=/usr/lib/NextPrinter/psrf:\ :vf=/usr/lib/NextPrinter/psvf:\ :cf=/usr/lib/NextPrinter/pscf:\ :df=/usr/lib/NextPrinter/psdf:\ :note=:\ :ty=NeXT 400 dpi Laser Printer:\ :lp=/dev/null:\ :sd=/usr/spool/NeXT/Local_Printer:\ :_ignore: netnp: \ :lp=:rm=remotehost:rp=remotename:\ :sd=/usr/spool/netnp: \ :ty=some printer: Note that you will always have a printcap entry in the local domain for a printer called Local_Printer. If there is no local printer configured, the _ignore property will be present, and the entry will be ignored (as in this example). 8. Create a spool directory, as specified with the sd= parameter: cd /usr/spool mkdir netnp chmod 770 netnp chown agent.daemon netnp You will need one spool directory for each printer you add. 9. Restart your NeXT computer. This is necessary only to create lpd print daemons for the printer. You can also use the lpc program to accomplish this. setting up for remote printing with a GatorBox A GatorBox acts as a gateway between TCP/IP and LocalTalk(R)/EtherTalk. The software that runs on the GatorBox makes it appear to be another UNIX host on the network, which runs the lpd spooling system. This "deception" makes it possible for the NeXT computer to send print jobs to the GatorBox. The GatorBox in turn converts these print requests into LocalTalk or AppleTalk(R) print requests and passes them along to the appropriate printer. Configuring a NeXT machine to work with a GatorBox is mainly a task of assigning names. The basic procedure is an extension of configuring a remote printer entry. The added twist is the configuration of the GatorBox. You'll use a utility called GatorKeeper(TM) to accomplish this. This utility is documented in the GatorShare(TM) User's Guide, which you should be familiar with before setting up anything. Before starting, review the general summary and the following specific example. The summary includes steps you should take prior to configuring your system to use a GatorBox. general summary 1. Install your network. Set up LocalTalk or EtherTalk and verify that it works before attaching the GatorBox. If you're also configuring a NeXT network, finish installing it before your proceed. Since GatorBoxes don't run NetInfo, you'll want to specify that the host doesn't run NetInfo by not checking the "This is host's parent netinfo domain" check box in NetManager. 2. Determine a unique IP address for the GatorBox. If you're on a campus or company network, obtain the appropriate addresses from the network administrator. 3. Follow the instructions in the GatorShare User's Guide for configuring and loading the GatorBox. When you specify printers, be sure to note their names-you'll need them later. 4. Place a host entry for the GatorBox in the appropriate NetInfo domain-this is typically the root-level domain for a network of NeXT computers or the local domain for a standalone system. If your network uses NIS (formerly Yellow Pages) or BIND (Berkeley Internet Name Domain) as the primary name resolution system, place the host name and IP address there. 5. Prepare a printcap entry to be loaded into NetInfo. Use the netlw sample entry in the /etc/printcap file as a guide (see the next section for details). 6. Load this entry into the appropriate domain in NetInfo-this time the entry must go into NetInfo. The appropriate domain should be the one that encompasses all machines authorized to use the printer. If you wish all machines to have access, place the entry in the root domain. 7. Create any spool directories and set ownerships. 8. Run GatorKeeper and configure the printers for the GatorBox. 9. Restart your NeXT computer. At this point, you should be ready to print. Try a small print job first. You may wish to monitor activity on the GatorBox by using GatorKeeper. a specific example This example shows how to configure a single NeXT machine to print to two devices on a LocalTalk network (see figure 1). In the example network, the machine called myhost is configured for a non-NetInfo network. Even NeXT machines on non-NetInfo networks use NetInfo to resolve information about their local domain. Thus, unlike other UNIX machines (on which you would use the /etc/printcap file to describe attached printers), you must instead place this information in the NetInfo database. figure 1: configuration for the example [Image] Here's what to do. Do these operations as root: 1. Create a host entry for the GatorBox using NetManager. Since there's only one NeXT machine on the network, place the host entry in the local NetInfo domain. 2. Place the following entries in a file in /tmp. You can save typing the entries by copying the last entry in the flat file /etc/printcap: NetLaserWriter|netlw:\ :lp=:rm=GatorBox07222\ :rp=Maclw:\ :sd=/usr/spool/lpd.lw:\ :ty=LaserWriter: NetTypeSetter|nettype:\ :lp=:rm=GatorBox07222:\ :rp=Mactypesetter:\ :sd=/usr/spool/lpd.typesetter:\ :ty=PhotoTypesetter: ty=printer type specifies the printer type. This string will appear in printing dialog boxes and is free format. If you want to have users see additional information about the printer, you can add a note= field. The text in this field will appear in print dialog boxes when the printer is selected. 3. Load the file into NetInfo: niload printcap .