* New version of IRM New version of the IRM, updated to Medley. * moved to docs/medley-irm as discussed
27 lines
20 KiB
Plaintext
27 lines
20 KiB
Plaintext
INTERLISP-D REFERENCE MANUAL
|
||
HARDCOPY FACILITIES
|
||
|
||
"29"28. HARDCOPY FACILITIES
|
||
2
|
||
|
||
Interlisp-D includes facilities for generating hardcopy in "Interpress" format and "Press" format. Interpress is a file format used for communicating documents to Xerox Network System printers such as the Xerox 8044 and Xerox 5700. Press is a file format used for communicating documents to Xerox laser Xerographic printers known by the names "Dover", "Spruce", "Penguin", and "Raven". There are also library packages available for supporting other types of printer formats (4045, FX-80, C150, etc.). The hardcopy facilities are designed to allow the user to support new types of printers with minimal changes to the user interface.
|
||
Files can be in a number of formats, including Interpress files, plain text files, and formatted Tedit files. In order to print a file on a given printer, it is necessary to identify the format of the file, convert the file to a format that the printer can accept, and transmit it. Rather than require that the user explicitly determine file types and do the conversion, the Interlisp-D hardcopy functions generate Interpress or other format output depending on the appropriate choice for the designated printer. The hardcopy functions use the variables PRINTERTYPES and PRINTFILETYPES (described below) to determine the type of a file, how to convert it for a given printer, and how to send it. By changing these variables, the user can define other kinds of printers and print to them using the normal hardcopy functions.
|
||
(SEND.FILE.TO.PRINTER(SEND.FILE.TO.PRINTER (Function) NIL NIL ("29") 1) FILE HOST PRINTOPTIONS) [Function]
|
||
The function SEND.FILE.TO.PRINTER causes the file FILE to be sent to the printer HOST. If HOST is NIL, the first host in the list DEFAULTPRINTINGHOST which can print FILE is used.
|
||
PRINTOPTIONS is a property list of the form (PROP1 VALUE1 PROP2 VALUE2 ...). The properties accepted depends on the type of printer. For Interpress printers, the following properties are accepted:
|
||
DOCUMENT.NAME The document name to appear on the header page (a string). Default is the full name of the file.
|
||
DOCUMENT.CREATION.DATE The creation date to appear on the header page (a Lisp integer date, such as returned by IDATE). The default value is the creation date of the file.
|
||
SENDER.NAME The name of the sender to appear on the header page (a string). The default value is the name of the user.
|
||
RECIPIENT.NAME The name of the recipient to appear on the header page (a string). The default is none.
|
||
MESSAGE An additional message to appear on the header page (a string). The default is none.
|
||
#COPIES The number of copies to be printed. The default value is 1.
|
||
PAGES.TO.PRINT The pages of the document that should be printed, represented as a list (FIRSTPAGE# LASTPAGE#). For example, if this option is (3 5), this specifies that pages 3 through 5, inclusive, should be printed. Note that the page numbering used for this purpose has no connection to any page numbers that may be printed on the document. The default is to print all of the pages in the document.
|
||
MEDIUM The medium on which the master is to be printed. If omitted, this defaults to the value of NSPRINT.DEFAULT.MEDIUM, as follows: NIL means to use the printer's default; T means to use the first medium reported available by the printer; any other value must be a Courier value of type MEDIUM. The format of this type is a list (PAPER (KNOWN.SIZE TYPE)) or (PAPER (OTHER.SIZE (WIDTH LENGTH))). The paper TYPE is one of US.LETTER, US.LEGAL, A0 through A10, ISO.B0 through ISO.B10, and JIS.B0 through JIS.B10. For users who use A4 paper exclusively, it should be sufficient to set NSPRINT.DEFAULT.MEDIUM to (PAPER (KNOWN.SIZE "A4")).
|
||
When using different paper sizes, it may be necessary to reset the variable DEFAULTPAGEREGION, the region on the page used for printing (measured in micas from the lower-left corner).
|
||
STAPLE? True if the document should be stapled.
|
||
#SIDES 1 or 2 to indicate that the document should be printed on one or two sides, respectively. The default is the value of EMPRESS#SIDES.
|
||
PRIORITY The priority of this print request, one of LOW, NORMAL, or HIGH. The default is the printer's default.
|
||
Note: Press printers only recognize the options #COPIES, #SIDES, DOCUMENT.CREATION.DATE, and DOCUMENT.NAME.
|
||
For example,
|
||
(SEND.FILE.TO.PRINTER 'FOO NIL
|
||
'(#COPIES 3 #SIDES 2 DOCUMENT.NAME "For John"))
|
||
SEND.FILE.TO.PRINTER calls PRINTERTYPE and PRINTFILETYPE to determine the printer type of HOST and the file format of FILE. If FILE is a formatted file already in a form that the printer can print, it is transmitted directly. Otherwise, CONVERT.FILE.TO.TYPE.FOR.PRINTER is called to do the conversion. [Note: If the file is converted, PRINTOPTIONS is passed to the formatting function, so it can include properties such as HEADING, REGION, and FONTS.] All of these functions use the lists PRINTERTYPES and PRINTFILETYPES to actually determine how to do the conversion.
|
||
LISTFILES (Chapter 17) calls the function LISTFILES1 to send a single file to a hardcopy printing device. Interlisp-D is initialized with LISTFILES1 defined to call SEND.FILE.TO.PRINTER.
|
||
(HARDCOPYW(HARDCOPYW (Function) NIL NIL ("29") 2) WINDOW/BITMAP/REGION FILE HOST SCALEFACTOR ROTATION PRINTERTYPE HARDCOPYTITLE) [Function]
|
||
Creates a hardcopy file from a bitmap and optionally sends it to a printer. Note that some printers may have limitations concerning how big or how "complicated" the bitmap may be printed.
|
||
WINDOW/BITMAP/REGION can either be a WINDOW (open or closed), a BITMAP, or a REGION (interpreted as a region of the screen). If WINDOW/BITMAP/REGION is NIL, the user is prompted for a screen region using GETREGION.
|
||
If FILE is non-NIL, it is used as the name of the file for output. If HOST = NIL, this file is not printed. If FILE is NIL, a temporary file is created, and sent to HOST.
|
||
To save an image on a file without printing it, perform (HARDCOPYW IMAGE FILE). To print an image to the printer PRINTER without saving the file, perform (HARDCOPYW IMAGE NIL PRINTER).
|
||
If both FILE and HOST are NIL, the default action is to print the image, without saving the file. The printer used is determined by the argument PRINTERTYPE and the value of the variable DEFAULTPRINTINGHOST. If PRINTERTYPE is non-NIL, the first host on DEFAULTPRINTINGHOST of the type PRINTERTYPE is used. If PRINTERTYPE is NIL, the first printer on DEFAULTPRINTINGHOST that implements the BITMAPSCALE (as determined by PRINTERTYPES) operation is used, if any. Otherwise, the first printer on DEFAULTPRINTINGHOST is used.
|
||
The type of hardcopy file produced is determined by HOST if non-NIL, else by PRINTERTYPE if non-NIL, else by the value of DEFAULTPRINTINGHOST, as described above.
|
||
SCALEFACTOR is a reduction factor. If not given, it is computed automatically based on the size of the bitmap and the capabilities of the printer type. This may not be supported for some printers.
|
||
ROTATION specifies how the bitmap image should be rotated on the printed page. Most printers (including Interpress printers) only support a ROTATION of multiples of 90.
|
||
PRINTERTYPE specifies what type of printer to use when HOST is NIL. HARDCOPYW uses this information to select which printer to use or what print file format to convert the output into, as described above.
|
||
The background menu contains a "Hardcopy" command (Chapter 28) that prompts the user for a region on the screen, and sends the image to the default printer.
|
||
Hardcopy output may also be obtained by writing a file on the printer device LPT, e.g. (COPYFILE 'FOO '{LPT}). When a file on this device is closed, it is converted to Interpress or some other format (if necessary) and sent to the default printer (the first host on DEFAULTPRINTINGHOST). One can include the printer name directly in the file name, e.g. (COPYFILE 'FOO {LPT}TREMOR:) will send the file to the printer TREMOR:.
|
||
HARDCOPYTITLE is a string specifying a title to print on the page containing the screen image. If NIL, the string "Window Image" is used. To omit a title, specify the null string.
|
||
|
||
(PRINTERSTATUS(PRINTERSTATUS (Function) NIL NIL ("29") 3) PRINTER) [Function]
|
||
Returns a list describing the current status of the printer named PRINTER. The exact form of the value returned depends on the type of printer. For InterPress printers, the status describes whether the printer is available or busy or needs attention, and what type of paper is loaded in the printer.
|
||
Returns NIL if the printer does not respond in a reasonable time, which can occur if the printer is very busy, or does not implement the printer status service.
|
||
DEFAULTPRINTINGHOST (DEFAULTPRINTINGHOST% (Variable) NIL NIL ("29") 3) [Variable]
|
||
The variable DEFAULTPRINTINGHOST is used to designate the default printer to be used as the output of printing operations. It should be a list of the known printer host names, for example, (QUAKE LISPPRINT:). If an element of DEFAULTPRINTINGHOST is a list, is interpreted as (PRINTERTYPE HOST), specifying both the host type and the host name. The type of the printer, which determines the protocol used to send to it and the file format it requires, is determined by the function PRINTERTYPE.
|
||
If DEFAULTPRINTINGHOST is a single printer name, it is treated as if it were a list of one element.ÿÿ |