7.1 CodeBuilder Print Spooling7.1.1 The Print Spooler Database7.2 Local Printing7.2.1 Printing Text Files to a PostScript LaserWriter on AppleTalk7.3 Selecting an Alternate Printer
7.2.2 Spooled Printing to an ASCII-Based ImageWriter Connected Directly to a Serial Port
7.4 Status and lp Management Programs
CodeBuilder supports UNIX-style spooled printing to PostScript LaserWriters
on AppleTalk and to ASCII-based ImageWriters on serial ports. These printing
capabilities support both UNIX and Macintosh applications. CodeBuilder supports
full UNIX print job control, including the management of multiple printers
and multiple spooling queues.
lp <file_name>lp is a CodeBuilder shell script which invokes pstext(1), generating formatted PostScript output from the text file. The PostScript output is then queued to the spooling area by lpr, where lpd spools the file to the LaserWriter on your AppleTalk network selected by Chooser. This is the default configuration for CodeBuilder. If you are not already running lpd, lp will start it for you. lp will accept pstext options allowing you to control the output format with respect to orientation, headers, fonts, etc.
iw|lp|ImageWriter|ImageWriter II:\
:MF:br#9600:fs#06320:\
:lp=/dev/ttyfa:\
:sd=/var/spool/iw:\
:tr=\f\f:\
:of=/usr/lib/lpf:\
:af=/var/spool/iw/acct:\
:lf=/var/spool/iw/errs:
NOTE: If you have a locally connected DeskWriter, uncomment the entry starting with dw|lp|DeskWriter:\ instead. The DeskWriter entry differs from the ImageWriter entry in the setting of the serial port speed (baud rate) designated by the :br#<table entry>: field in the entry. Modify this field as necessary to match the baud rate of your DeskWriter according to the following table:
br#
entry | DeskWriter Baud Rate |
50 | 14.4 Kbps |
75 | 28.8 Kbps |
110 | 57.6 Kbps |
300 | 300 bps |
600 | 600 bps |
1200 | 1200 bps |
1800 | 1800 bps |
2400 | 2400 bps |
4800 | 4800 bps |
9600 | 9600 bps |
19200 | 19.2 Kbps |
38400 | 38.4 Kbps |
The default serial port speed setting for DeskWriter entry in /etc/printcap is 57.6K baud.
- If the ImageWriter is connected to the printer port, change the line that says lp=/dev/ttyfa to read lp=/dev/ttyfb. If the ImageWriter is connected to the modem (phone) port, skip this step - printcap is already set in this configuration.
- Print a UNIX file by using one of the following two commands:
If lpd is not running, the following error message will appear:pr <file_name> | lpr -PiwThe first version will paginate the output; the second version will produce "raw" output.
lpr -Piw <file_name>lpr: connect: No such file or directoryIn order to start lpd, you must su to root and then start the daemon by giving the command /usr/sbin/lpd. If you print from CodeBuilder frequently, edit the /etc/rc.conf file to start lpd automatically.
jobs queued, but cannot start daemon
NOTES: The ImageWriter is not selected with the Chooser, but with the -P option of the lpr command. The name following -P may be any one of the names listed on the first line of the /etc/printcap entry for the ImageWriter - iw and ImageWriter work equally well in this case. Macintosh files, such as Microsoft Word files with embedded formatting characters, must be printed from their Macintosh application and cannot be printed with an lp, lpr or pr command. Macintosh programs can access the ImageWriter as they normally do via Chooser.
:at=mylaser\:LaserWriter@*:An "at" entry in the /etc/printcap file specifies the AppleTalk name of a printer. An "at" entry must include the complete AppleTalk name, type, and zone designator in standard AppleTalk format (<name>:<type>@<zone>). A '*' may be used to refer to the "local" zone. The colons at the beginning and end of the entry are required to distinguish the entry from other parameters. The above entry designates a LaserWriter with the AppleTalk name mylaser, of type LaserWriter, associated with the local zone. Note the use of the required backslash to escape a colon internal to the specification. If the name field entry is null, the CodeBuilder system will retrieve the name of the printer from the information saved by the Chooser.
The lprm(1) command is used to delete already queued print files that you have subsequently decided not to print. Lprm will first look locally for queued files and then contact any remote spooling systems to request that files be deleted. Files are specified by the job numbers obtained from lpq. For example:lp is ready and printing Rank Owner Job Files Total Size active holmgren 685 standard input 24799 bytes
lprm 685Finally, the lpc(8) program is used to perform larger management operations with printers and queues of print jobs. lpc will enable or disable the overall operations of a specific printer, enable or disable the spooling queue of a printer, rearrange the order of jobs in the spooling queue, and find the status of printers, associated spool queues and spooling daemon software.