Developer Note Apple LaserWriter Select 310 Printer Developer Note Developer Press © Apple Computer, Inc.
Apple Computer, Inc. © 2000, Apple Computer, Inc. All rights reserved. No part of this publication or the software described in it may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, mechanical, electronic, photocopying, recording, or otherwise, without prior written permission of Apple Computer, Inc., except in the normal use of the software or to make a backup copy of the software.
Contents Figures and Tables Preface About This Note vii ix What This Note Contains ix Conventions Used in This Note Other Reference Material x For More Information xi Chapter 1 LaserWriter Select 310 Hardware Communication Ports 4 Serial Port for RS-232C Devices Centronics Parallel Connector Status Lights 8 Memory Capabilities 9 ROM Capability 9 DRAM Expansion 10 Basic Operation 10 Batch Mode 10 Interactive Mode 11 Page Types 11 Paper Handling 12 Chapter 2 x 1 4 5 LaserWriter Select 310 Software
pagecount 23 printername 24 product 24 productA 24 ramsize 24 revision 24 setdefaulttimeouts 25 setidlefonts 25 setpassword 25 setprintername 26 Setting Page Device Parameters 26 defaultmultipurposetraysize 26 defaultpapertray 26 dostartpage 26 manualfeed 27 manualfeedtimeout 27 margins 27 pagestackorder 27 papersize 28 papertray 28 setdefaultmultipurposepapertraysize 28 setdefaultpapertray 29 setdostartpage 29 setmargins 29 setpagestackorder 30 setpagetype 30 setpapertray 30 Setting User Parameters 31 jobn
setcacheparams 37 setpacking 38 Printer Error Parameter 38 printererror 39 PostScript Language Changes 39 Packed Arrays 40 Packed Arrays Versus Ordinary Arrays Creating Packed Arrays 40 Immediately Evaluated Names 41 Changes in Font Cache Operation 42 Device Resolution Images 42 End-of-Line Recognition 43 New Operators 44 TrueType Fonts 44 Chapter 3 Communication Channels 40 45 Serial Communication 46 Baud Rates 46 Parity Settings 47 Flow Control 47 DTR Flow Control 47 XON/XOFF Flow Control 48 SCC Oper
Figures and Tables Chapter 1 Chapter 2 LaserWriter Select 310 Hardware Figure 1-1 Figure 1-2 Figure 1-3 Figure 1-4 Figure 1-5 Figure 1-6 Figure 1-7 LaserWriter Select 310 printer side panel connectors 4 An 8-pin serial port connector 5 A Centronics parallel connector 6 Timing for a Centronics interface 7 Status lights 8 The ROM and DRAM locations on a printed circuit board Paper handling options 13 Table 1-1 Table 1-2 Table 1-3 Table 1-4 Table 1-5 LaserWriter Select 310 printer features 3 Signal descr
P R E F A C E About This Note The LaserWriter Select 310 printer is a new member of Apple’s LaserWriter printer family. It is an economical printer that supports the Adobe™ PostScript™ Level 1 programming language. This developer note describes the features and capabilities of the printer, and it is intended for use by software and hardware developers. To use this note, you need to understand the PostScript Level 1 programming language.
P R E F A C E Conventions Used in This Note 0 The following visual cues are used throughout this note to identify different types of information: Note A note like this contains information that is interesting but not essential for an understanding of the main text. ◆ IMPORTANT This type of note contains information that is essential for an understanding of the main text.
P R E F A C E For More Information 0 APDA is Apple’s worldwide source for over three hundred development tools, technical resources, training products, and information for anyone interested in developing applications on Apple platforms. Customers receive the quarterly APDA Tools Catalog featuring all current versions of Apple development tools and the most popular third-party development tools.
C H A P T E R Figure 1-0 Listing 1-0 Table 1-0 1 LaserWriter Select 310 Hardware 1
C H A P T E R 1 LaserWriter Select 310 Hardware The LaserWriter Select 310 printer is an economical laser printer that supports PostScript™ Level 1 functions. It executes page descriptions written in the PostScript language, and it produces printed pages at a rate of up to five pages per minute. The raster printing technology is xerographic, black and white, and write black at 300 dots (pixels) per inch.
C H A P T E R 1 LaserWriter Select 310 Hardware Table 1-1 LaserWriter Select 310 printer features Features Specifications Printing speed 5 pages per minute Warm-up time 90 seconds (worst case) Imaging 300 dpi Processor Advanced Micro Devices Am29205, 16 MHz Paper handling Standard Output: 150-page, face-down tray Inputs: Manual feed tray; 250-page feeder with 250-page universal cassette Optional Inputs: additional 250-page feeder; additional 500-page feeder; 250-page legal-size cassette, 30-
C H A P T E R 1 LaserWriter Select 310 Hardware Communication Ports 1 The LaserWriter Select 310 printer supports two communication ports: ■ RS-232 8-pin serial port ■ Centronics 36-pin parallel port Figure 1-1 shows the relative positions of these ports on the rear panel of the printer.
C H A P T E R 1 LaserWriter Select 310 Hardware Figure 1-2 8 An 8-pin serial port connector 7 5 6 4 2 Table 1-2 3 Connected to chassis ground 1 Signal descriptions for an 8-pin serial port Pin number Signal name I/O Description 1 DTR I Data terminal ready. Send data when this signal is asserted. 2 DSR O Data set ready.
C H A P T E R 1 LaserWriter Select 310 Hardware Figure 1-3 shows the pin designations for the Centronics parallel connector and Table 1-3 lists the signal descriptions. Figure 1-4 shows the timing requirements for the Centronics interface.
C H A P T E R 1 LaserWriter Select 310 Hardware Table 1-3 Pin number Signal descriptions for a Centronics parallel port (continued) Signal name I/O Description 19-30 SIGNAL GROUND – Signal ground 31 Not connected – This line is not connected 32 /FAULT O Fault signal; asserted if there is a printer problem 33-36 Not connected – These lines are not connected NOTE Inputs and outputs are referenced to the printer.
C H A P T E R 1 LaserWriter Select 310 Hardware Status Lights 1 The LaserWriter Select 310 printer has three colored lights on the left side of the printer. These lights indicate what the printer is doing. Figure 1-5 shows a view of the status light symbols, and Table 1-4 describes the functions of the lights.
C H A P T E R 1 LaserWriter Select 310 Hardware Memory Capabilities 1 The standard configuration of the LaserWriter Select 310 printer comes with 1MB of ROM and 1.5 MB of DRAM. Figure 1-6 shows the positioning of the DRAM and ROM on the printer’s main circuit board.
C H A P T E R 1 LaserWriter Select 310 Hardware DRAM Expansion 1 The LaserWriter Select 310 printer comes with 1.5 MB of DRAM installed on the printer’s main circuit board. As shown in Figure 1-6, there are three DRAM devices: two 512K x 8 bit devices, and one 256K x 16 bit device. These three DRAMs present a 16-bit interface to the microprocessor installed on the printed circuit board.
C H A P T E R 1 LaserWriter Select 310 Hardware Interactive Mode 1 You can use the LaserWriter Select 310 printer as a personal computer, and control it directly by means of a terminal or other input device. This way of using the printer is known in this context as interactive mode. It allows you to experiment with the PostScript language.
C H A P T E R 1 LaserWriter Select 310 Hardware Paper Handling 1 The LaserWriter Select 310 printer offers a variety of paper handling features, as shown in Figure 1-7. It has three paper feeders and six types of cassettes: ■ The manual feeder is an integral part of the printer. To use it, you pull down a small flap on the front of the printer.
C H A P T E R 1 LaserWriter Select 310 Hardware Figure 1-7 Paper handling options Options Base product Feeders 50 Sheet 5 Env Cassettes Universal Multi-purpose tray Manual feed tray 250 Legal 250 250 250 Legal Universal 30 Env 30 Env Extended configurations 500 B5 500 500 Letter 250 500 A4 250 500 250 500-sheet capacity 750-sheet capacity Key The printer with 50-sheet manual feed Feeder Paper Handling Cassettes (paper trays) 13
C H A P T E R Figure 2-0 Listing 2-0 Table 2-0 2 LaserWriter Select 310 Software 2
C H A P T E R 2 LaserWriter Select 310 Software This chapter describes the LaserWriter Select 310 software. ■ It provides an overview of software features, including the Adobe PostScript Programming Language, the PostScript interpreter, the LaserWriter Select 310 driver, and page types. ■ It defines the software parameters that enable you to set up and configure the LaserWriter Select 310 printer.
C H A P T E R 2 LaserWriter Select 310 Software The special operators are intended for use by interactive users, by programmers of host software that carries out user requests, or by users who may want to configure the LaserWriter Select 310 printer in non-standard ways. Normally page descriptions should not refer to the special operators, since doing so impairs portability.
C H A P T E R 2 LaserWriter Select 310 Software Table 2-1 18 Paper tray selection operators Operator Description a4tray Selects the paper tray containing A4-size paper and sets the page type to either a4 or a4small, depending on the value of pagetype. This operator raises the PostScript language error rangecheck if there is no paper tray containing A4-size paper. a5tray Selects the paper tray containing A5-size paper and sets the page type to a5.
C H A P T E R 2 LaserWriter Select 310 Software Product Strings 2 Table 2-2 lists values assigned to the product strings associated with the LaserWriter Select 310 printer. Table 2-2 Product string values String name Type Value product string LaserWriter Select 310 productA string LaserWriter Select 310 version string 52.5 Software Parameters 2 This section defines the software parameters that enable you to set up and configure the LaserWriter Select 310 printer.
C H A P T E R 2 LaserWriter Select 310 Software The compatibility operators present in the LaserWriter Select 310 printer appear in three dictionaries: statusdict, and userdict. Table 2-3 lists these operators by dictionary group.
C H A P T E R 2 LaserWriter Select 310 Software Setting Compatibility Operators 2 The LaserWriter Select 310 printer has an extensive collection of parameters that control its behavior.
C H A P T E R 2 LaserWriter Select 310 Software Table 2-4 22 LaserWriter Select 310 Parameters (continued) Type Name Persistent/volatile Page device parameters defaultmultipurposetraysize defaultpapertray dostartpage manualfeed manualfeedtimeout margins pagestackorder papersize papertray setdefaultmultipurposetraysize setdefaultpapertray setdostartpage setmargins setpagestackorder setpagetype setpapertray Persistent Persistent Persistent Volatile Volatile Persistent Persistent Volatile Volatile P
C H A P T E R 2 LaserWriter Select 310 Software Setting System Parameters 2 This section describes the compatibility operators that set Level 1 system parameters. checkpassword 2 Syntax int checkpassword bool Definition This operator checks the validity of the current password. It returns true if int is equal to the current system administrator password. Otherwise, after delaying for one second, it returns false.
C H A P T E R 2 LaserWriter Select 310 Software printername 2 Syntax string printername substring Definition This operator stores the value of the system parameter PrinterName in string and returns a string object designating the substring actually used.
C H A P T E R 2 LaserWriter Select 310 Software setdefaulttimeouts Syntax job manualfeed wait setdefaultimeouts – Definition This operator establishes the default values for the three timeouts. It returns the following: Errors ■ system parameter jobtimeout for job ■ system parameter waittimeout for wait ■ manualfeedtimeout for manualfeed 2 invalidaccess, rangecheck, stackunderflow, typecheck setidlefonts 2 Syntax mark font sxsy rot nchars ...
C H A P T E R 2 LaserWriter Select 310 Software setprintername Syntax string setprintername – Definition This operator establishes the string to be the printer’s name. 2 To maintain compatibility with the Personal LaserWriter NT which includes AppleTalk, the string should be no longer than 31 characters. It should consist entirely of printing characters, and should not contain the characters : or @.
C H A P T E R 2 LaserWriter Select 310 Software manualfeed 2 Syntax – manualfeed bool Definition If manualfeed is true at the time of a showpage or copypage, then that page will be fed manually. Otherwise, the page will not be fed manually.
C H A P T E R 2 LaserWriter Select 310 Software papersize 2 Syntax – papersize name bool Definition This operator returns the name of the operator that selects a tray containing paper of the current size. For example, if the current paper size is letter, this operator returns the value /lettertray. The value of bool is true if the page feeds short edge first, false if the page feeds long edge first. Standard value: The operator appropriate for the tray specified by papertray.
C H A P T E R 2 LaserWriter Select 310 Software setdefaultpapertray Syntax tray setdefaultpapertray – Definition When the server begins a job, it establishes the default paper tray as the tray from which it will feed paper, and it sets up an imageable area corresponding to the size of paper in that tray.
C H A P T E R 2 LaserWriter Select 310 Software setpagestackorder 2 Syntax bool setpagestackorder – Definition This operator sets value returned by pagestackorder. A value of true indicates that the output is going to the face-down tray. A value of false indicates that the output is directed to the face-up tray. Since the LaserWriter Select 310 printer has only a face-down tray, true is the only correct value for this parameter.
C H A P T E R 2 LaserWriter Select 310 Software Setting User Parameters 2 This section describes the compatibility operators that set Level 1 user parameters. jobname 2 Syntax – jobname string Definition This operator is a string with the same value as the user parameter JobName. It specifies the name of the current job.
C H A P T E R 2 LaserWriter Select 310 Software waittimeout 2 Syntax – waittimeout int Definition This operator is the wait timeout currently in effect, that is, it is the number of seconds the LaserWriter Select 310 printer will wait to receive additional characters from the host before it aborts the current job by executing a timeout. At the beginning of a job, the server initializes waittimeout to the default wait time returned by defaulttimeout.
C H A P T E R 2 LaserWriter Select 310 Software softwareiomode 2 Syntax int setsoftwareiomode – Definition This operator sets the binary protocol mode of the communications channel according to the value of int: 0 100 binary protocol off binary protocol on Binary protocol is standard in the LaserWriter Select 310 printer, and it should be used by any driver that sends binary data to the printer.
C H A P T E R 2 LaserWriter Select 310 Software sccbatch 2 Syntax channel sccbatch baud options Definition This operator returns the baud rate and options for the specified serial channel. Channel 9 only is available with this printer. baud and options affect the following device parameters: ■ Baud, StopBits, and FlowControl ■ DataBits and Parity ■ CheckParity See “setsccbatch” for further information. The values for data bits and parity are determined by the bit positions.
C H A P T E R 2 LaserWriter Select 310 Software setsccbatch 2 Syntax channel baud options setsccbatch – Definition This operator sets the communication parameters as specified by three integers: channel, which designates the serial channel.
C H A P T E R 2 LaserWriter Select 310 Software setdarkness 2 Syntax real setdarkness – Definition This operator sets the printer’s laser density according to the value specified by real, where a value of 0 is the least dense and a value of 1 is the most dense. This causes the printer’s output to be either lighter or darker, depending on whether the darkness value is lowered or increased from the current value. The printer itself has only five darkness settings: 0, .25, .5, .75, and 1.
C H A P T E R 2 LaserWriter Select 310 Software packedarray 2 Syntax any0...anyn-1 packedarray packedarray Definition This operator creates a packed array object of length n. The array object contains the objects any0 through anyn-1 as elements. The packed array operator first removes the non-negative integer n from the operand stack, creates a packed array containing those objects as elements, and finally pushes the resulting packed array object onto the operand stack.
C H A P T E R 2 LaserWriter Select 310 Software setpacking 2 Syntax bool setpacking – Definition This operator determines the type of executable arrays subsequently created by the PostScript interpreter’s scanner. It sets the array packing mode to the specified boolean value. The value true selects packed arrays. The value false selects ordinary arrays.
C H A P T E R 2 LaserWriter Select 310 Software printererror 2 Syntax status tries printererror – Definition This procedure is called during execution of showpage or copypage if the printer mechanism reports an error such as out of paper, no paper tray, paper jam, cover open, and so on. status is an integer that encodes details of the error condition. It is device dependent and is not documented in this developer note.
C H A P T E R 2 LaserWriter Select 310 Software Packed Arrays 2 PostScript language procedures are represented as executable arrays, which were previously stored in the same fashion as literal data arrays. This type of representation offers maximum flexibility but is very costly in terms of space, requiring 8 bytes per element. Large PostScript Language programs, such as the built-in server program, and downloaded preambles, consume considerable amounts of virtual memory.
C H A P T E R 2 LaserWriter Select 310 Software The second way to create a packed array is to build it explicitly by invoking the packedarray operator with a list of operands to be incorporated into a new packed array. Immediately Evaluated Names 2 The PostScript language syntax has been extended to include a new kind of name token, the immediately evaluated name.
C H A P T E R 2 LaserWriter Select 310 Software Changes in Font Cache Operation 2 Operation of the font cache has changed in the LaserWriter Select 310 printer. Formerly, there was a single limit on the number of bytes occupied by a character in the cache. Any character larger than the space allocated would not be cached. Now there are two cache thresholds, a lower and an upper threshold.
C H A P T E R 2 LaserWriter Select 310 Software End-of-Line Recognition 2 In PostScript interpreter versions 40.0 and later, the scanner and the readline operator recognize all three external forms of end of line (LF alone, CR alone, and CR LF pair) and treat them uniformly. The PostScript interpreter does not translate data read or written by any other means.
C H A P T E R 2 LaserWriter Select 310 Software 5. Data read by read and readstring undergoes no EOL translation. Whatever characters were received from the channel are read by the PostScript interpreter. However, the channel itself may be performing some EOL translation. For example, the serial and parallel channels on the LaserWriter Select 310 printer may affect the input data, as described in Table 3-3, in Chapter 3, “Communication Channels.” 6.
C H A P T E R Figure 3-0 Listing 3-0 Table 3-0 3 Communication Channels 3
C H A P T E R 3 Communication Channels The LaserWriter Select 310 printer has two communication ports that support two communication channels. One port is the RS-232 serial port used for serial communication. The other is the Centronics parallel port used to connect the LaserWriter Select 310 printer to an IBM-PC compatible computer. The section “Communication Ports,” in Chapter 1, describes the physical characteristics of the connectors.
C H A P T E R 3 Communication Channels Parity Settings 3 The parity settings for the serial channel may be odd, even, space, or mark. Table 3-2 indicates how the parity setting and number of data bits work together. Table 3-2 Data and parity choices for the LaserWriter Select 310 printer Data bits Parity Description Standard Space 8 bits are sent. The 8th bit transmitted is zero, and the 8th bit received is ignored. Standard Odd or even 8 bits are sent. The 8th bit is used for parity.
C H A P T E R 3 Communication Channels XON/XOFF Flow Control 3 XON/XOFF flow control uses two special characters, XON and XOFF, that may be sent either to the printer or to the host to control the flow of characters. When the LaserWriter Select 310 printer sends an XOFF character to the host, the host must immediately stop sending characters to the printer. When the printer sends XON to the host, the host may start sending characters again.
C H A P T E R 3 Communication Channels Figure 3-1 SCC operator encoding Example 9 19200 2 setsccbatch sum of decimal values : Feature Description Parity Even 2 Flow control XON/XOFF 0 Data bits Standard Stop bits 1 Decimal value 0 0 baud rate: 19200 channel type: 8-pin serial Communication Protocols 3 The LaserWriter Select 310 printer supports both simple and binary communication protocols for serial and parallel channels.
C H A P T E R 3 Communication Channels Table 3-4 Reserved characters in simple communication protocol (continued) Character ASCII code Control-Q 17 Start output (XON). Function only if XON/XOFF flow control is in use. Control-T 20 Status query. Causes the server to produce a one-line message that describes what the server is doing. Return 13 End of line. Translated to the PostScript language newline character. Line-feed 10 End of line. This is the PostScript language newline character.
C H A P T E R 3 Communication Channels Since any character code can be transmitted as data with this protocol, it can be used for sending PostScript language jobs that contain binary images. Binary protocol is set by default when the LaserWriter Select 310 printer is powered on. It may also be selected by setting softwareiomode to 100. This protocol requires that a quoting character be inserted at certain places in the data stream and that the character codes for certain characters be altered.
C H A P T E R 3 Communication Channels After CTL-A is received, the next character received that is not one of the special characters must be the result of XORing one of the special characters with 40 hex. If any other character is received, it is considered to be an input error. Any number of special characters may appear between CTL-A and the XORed character, with the exception of special characters CTRL-D and CTRL-A, which are handled asynchronously.
C H A P T E R 3 Communication Channels Unlike the serial port, the Centronics parallel input allows no parameters. It always accepts 8-bit data with no parity, and it reserves the same set of characters for communication functions that the serial port reserves, with the exception of XON/XOFF characters, which are passed through the PostScript interpreter, since flow control is maintained by means of the /BUSY signal. The Centronics parallel interface is essentially an input-only channel.
C H A P T E R 3 Communication Channels XON/XOFF Flow Control for PC Communication 3 To set up the LaserWriter Select 310 printer for serial interface with the IBM PC over the serial port using XON/XOFF flow control at 19200 baud, issue the following MS-DOS commands to your computer: MODE COM1:19200,N,8,1 MODE LPT1:=COM1: These commands alone are not sufficient to handle XON/XOFF flow control. Some applications may handle this protocol themselves.
C H A P T E R 3 Communication Channels Typically, characters written to the standard output file by PostScript operators, such as print, are not sent immediately. They are buffered until a flush is executed.
C H A P T E R 3 Communication Channels All messages generated spontaneously by the server (as opposed to those messages produced when the PostScript language program executes print) conform to the same syntax as status messages. They are sent as ordinary data through the communication channel, in sequence with any other characters written to the standard output file.