Documentation Archive Developer
Search

ADC Home > Reference Library > Technical Q&As > Legacy Documents > Graphics & Imaging >

Legacy Documentclose button

Important: This document is part of the Legacy section of the ADC Reference Library. This information should not be used for new development.

Current information on this Reference Library topic can be found here:

Print Job Cancelling


Important for all Apple Printing and Graphics Developers:

The information in this Technical Q & A is still relevant up to and including Mac OS 7.6 with QuickDraw GX 1.1.5. Beginning with the release of Mac OS 8.0, however, Apple plans to deliver a system which incorporates QuickDraw GX graphics and typography only. QuickDraw GX printer drivers and GX printing extensions will not be supported in Mac OS 8.0 or in future Mac OS releases. Apple's goal is to simplify the user experience of printing by unifying the Macintosh graphic and printing architectures and standardizing on the classic Printing Manager.

For details on Apple's official announcement, refer to </dev/technotes/gxchange.html>

Q: I've been experimenting to see what happens when a print job is cancelled part of the way through, and if I cancel when OpenConnection and StartSendPage have both completed successfully, I get unexpected CleanUpOpenConnection and CleanupStartSendPage messages. If I cancel at another other point in the job (for example, during RenderPage via the Remove button in the DTP status window), CleanUpStartSendPage and CleanUpOpenConnection messages are passed through after ImageDocument exits. This behavior seems very odd, and it doesn't appear to be discussed anywhere in the documentation. Shouldn't CleanUpOpenConnection and CleanupStartSendPage be called only if their respective routines return an error?

A: The unexpected CleanUpOpenConnection and CleanupStartSendPage messages are coming from the default implementations of ImageJob and ImagePage. The ImageJob code tries to Send_GXSetupImageData, and if an error occurs, it sends CleanUpOpenConnection. ImagePage tries to Send_GXRenderPage and sends CleanupStartSendPage if an error occurs.

If GXStartSendPage and/or GXOpenConnection do not complete successfully, the respective clean-up calls are not sent. These clean-up calls are sent only if openConnection and/or startSendPage are completed, and something goes wrong after completion.

Although the documentation states otherwise, this behavior is correct for the existing code, as shown here:

ImageJob
...
Send_GXOpenConnection(_);
if (anErr) <dispose of data>
Send_GXSetupImageData(_);
if (anErr)
{
  Send_GXCleanUpOpenConnection(_);
  <dispose of data>
}
...
ImagePage
...
Send_GXStartSendPage(_);
if (anErr) <dispose of data>
Send_GXRenderPage(_);
if (anErr)
{
  Send_GXCleanupStartSendPage(_);
  <dispose of data>
}
...

[May 01 1995]