Important: The information in this document is obsolete and should not be used for new development.
PrError
You can use thePrError
function to get the result code returned by the last Printing Manager routine.
FUNCTION PrError: Integer;DESCRIPTION
ThePrError
function returns the error reported by the last Printing Manager routine. If an error that does not belong to the Printing Manager occurs during the printing process, the Printing Manager puts it into low memory, where it can be retrieved with a call toPrError
. The Printing Manager then terminates the printing loop if necessary. If you encounter an error in the middle of a printing loop, do not end printing abruptly; call the close routines for any open routines you have already made and let the Printing Manager terminate properly.Do not display any alert or dialog boxes to report an error until the end of the printing loop. Once at the end, check for the error again; if there is no error, assume that printing completed normally. If the error is still present, then you can alert the user.
The most common error encountered is
PAPNoPrinter
, which is usually generated if no printer is selected. Since this error is so common, it is a good idea to create and display an alert box asking the user to select a printer from the Chooser when this error is encountered.ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for thePrError
function are
Trap macro Selector _PrGlue $BA000000 RESULT CODES
The following result codes are specific to the LaserWriter 8 printer driver:
iPrAbort 128 Application or user requested cancel opNotImpl 2 Requested PrGeneral
opcode not implemented in the current printer drivernoSuchRsl 1 Resolution requested with the PrGeneral
procedure is not supportednoErr 0 No error iPrSavPFil -1 Problem saving print file controlErr -17 Unimplemented control instructions; the Device Manager returns this result code iIOAbort -27 I/O error iMemFullErr -108 There is not enough room in the heap zone resNotFound -192 The current printer driver does not support PrGeneral
(described on page 9-69); you should clear this error with a call toPrSetError
(described in the next section) with a parameter value of 0; otherwise,PrError
might still contain this error the next time you check it
PAPNoCCBs -4096 There are no free connect control blocks (CCBs) available PAPBadRefnum -4097 Bad connection reference number PAPActive -4098 The request is already active PAPTooBig -4099 The write request is too big PAPConnClosed -4100 The connection is closed PAPNoPrinter -4101 The printer is not found, is closed, or is not selected -8131 Printer not responding manualFeedTOErr -8132 A timeout occurred (that is, no communication has occurred with the printer for two minutes); this is usually caused by an extremely long imaging time or a dropped connection generalPSErr -8133 A PostScript error occurred during transmission of data to the printer; this is most often caused by a bug in the application-supplied PostScript code zoomRangeErr -8160 The print image enlarged by the user with the Page Setup dialog box overflows the available page resolution errBadFontKeyType -8976 Font found in printer is not Type 1, TrueType, or bitmapped font errPSStateUnderflow -8977 PostScript stack underflow while restoring graphics state errNoPattern -8978 The pixel pattern could not be found and could not be built errBadConverterID -8979 The 'PDEF'
converter doesn't existerrNoPagesSpooled -8980 Application called PrOpenDoc
andPrCloseDoc
without callingPrOpenPage
andPrClosePage
in betweenerrNullColorInfo -8981 The getColor
function called with nullGetColorInfo
handleerrPSFileNameNull -8982 The filename pointer for the spool file is null errSpoolFolderIsAFile -8983 The spool folder is a file instead of a folder errBadConverterIndex -8984 When saving a spool file
to disk, the valuefileTypeIndex
had no matching entry in the drivererrDidNotDownloadFont -8985 A PostScript outline could not be found for a PostScript font, and there is no associated 'sfnt'
resourceerrBitmapFontMissing -8986 Unable to build bitmap for font errPSFileName -8987 PostScript file isn't named errCouldNotMakeNumberedFilename -8989 Could not make a unique filename for the spool file errBadSpoolFileVersion -8990 Bad version number in header of spool file errNoProcSetRes -8991 The resource describing needed procedure sets is unavailable for the PostScript prolog errInLineTimeout -8993 The printer is not responding errUnknownPSLevel -8994 The PostScript level has an unknown value errFontNotFound -8995 Font query reply didn't match any fonts in list of PostScript names errSizeListBad -8996 The size list contained an entry that could not be reconciled with the typeface list errFaceListBad -8997 Entry could not be found in typeface list errNotAKey -8998 Key for desired font number and style could not be found in font table SEE ALSO
See "Handling Printing Errors" on page 9-38 for more information on usingPrError
. See the chapter "Dialog Manager" in Inside Macintosh: Macintosh Toolbox Essentials for information about displaying alert and dialog boxes.