Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Imaging With QuickDraw /
Chapter 9 - Printing Manager / Printing Manager Reference
Printing Manager Routines / Handling Printing Errors


You can use the PrError function to get the result code returned by the last Printing Manager routine.

FUNCTION PrError: Integer;
The PrError 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 to PrError. 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.

The trap macro and routine selector for the PrError function are
Trap macroSelector

iPrAbort128Application or user requested cancel
opNotImpl2Requested PrGeneral opcode not implemented in the current printer driver
noSuchRsl1Resolution requested with the PrGeneral procedure is not supported
noErr0No error
iPrSavPFil-1Problem saving print file
controlErr-17Unimplemented control instructions; the Device Manager returns this result code
iIOAbort-27I/O error
iMemFullErr-108There is not enough room in the heap zone
resNotFound-192The current printer driver does not support PrGeneral (described on page 9-69); you should clear this error with a call to PrSetError (described in the next section) with a parameter value of 0; otherwise, PrError might still contain this error the next time you check it
The following result codes are specific to the LaserWriter 8 printer driver:
PAPNoCCBs-4096There are no free connect control blocks (CCBs) available
PAPBadRefnum-4097Bad connection reference number
PAPActive-4098The request is already active
PAPTooBig-4099The write request is too big
PAPConnClosed-4100The connection is closed
PAPNoPrinter-4101The printer is not found, is closed, or is not selected
 -8131Printer not responding
manualFeedTOErr-8132A 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-8133A 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-8160The print image enlarged by the user with the Page Setup dialog box overflows the available page resolution
errBadFontKeyType-8976Font found in printer is not Type 1, TrueType, or bitmapped font
errPSStateUnderflow-8977PostScript stack underflow while restoring graphics state
errNoPattern-8978The pixel pattern could not be found and could not be built
errBadConverterID-8979The 'PDEF' converter doesn't exist
errNoPagesSpooled-8980Application called PrOpenDoc and PrCloseDoc without calling PrOpenPage and PrClosePage in between
errNullColorInfo-8981The getColor function called with null GetColorInfo handle
errPSFileNameNull-8982The filename pointer for the spool file is null
errSpoolFolderIsAFile-8983The spool folder is a file instead of a folder
errBadConverterIndex-8984When saving a spool file
to disk, the value fileTypeIndex had no matching entry in the driver
errDidNotDownloadFont-8985A PostScript outline could not be found for a PostScript font, and there is no associated 'sfnt' resource
errBitmapFontMissing-8986Unable to build bitmap for font
errPSFileName-8987PostScript file isn't named
errCouldNotMakeNumberedFilename-8989Could not make a unique filename for the spool file
errBadSpoolFileVersion-8990Bad version number in header of spool file
errNoProcSetRes-8991The resource describing needed procedure sets is unavailable for the PostScript prolog
errInLineTimeout-8993The printer is not responding
errUnknownPSLevel-8994The PostScript level has an unknown value
errFontNotFound-8995Font query reply didn't match any fonts in list of PostScript names
errSizeListBad-8996The size list contained an entry that could not be reconciled with the typeface list
errFaceListBad-8997Entry could not be found in typeface list
errNotAKey-8998Key for desired font number and style could not be found in font table

See "Handling Printing Errors" on page 9-38 for more information on using PrError. See the chapter "Dialog Manager" in Inside Macintosh: Macintosh Toolbox Essentials for information about displaying alert and dialog boxes.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996