ADC Home > Reference Library > Technical Notes > Legacy Documents > Printing >

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:

QuickDraw GX Printing Q&As

CONTENTS

This Technical Note contains a collection of archived Q&As relating to a specific topic--questions sent the Developer Support Center (DSC) along with answers from the DSC engineers. Current Q&A's can be found on the Macintosh Technical Q&A's web site.

[Oct 01 1990]






QuickDraw GX printing extensions and creator types

Date Written: 5/3/93

Last reviewed: 7/2/93

A QuickDraw GX printing extension I've already written works fine, but when I install my latest creation, it doesn't show up in the print dialog - only my old printing extension does. Both extensions are the same except for a few lines of code in their gxDespoolPage message overrides. What's going on?

Your printing extensions shouldn't have the same creator type. QuickDraw GX requires unique creator types for drivers and printing extensions, just as the Finder does for applications. A creator type must be unique because QuickDraw GX uses it to build its chain of message handlers. If two printing extensions have the same creator, there's no way to determine which is which in the chain. You can register creator types for your printer drivers and printing extensions with the Developer Support Center (AppleLink DEVSUPPORT).

Back to top

NewMessageGlobals and global data

Date Written: 2/1/93

Last reviewed: 7/2/93

Why can't I get NewMessageGlobals to work in my gxInitialize message for my QuickDraw GX printing extension? The global data I try to initialize isn't being accessed correctly.

You shouldn't call NewMessageGlobals from any routine in which you access your global data. Otherwise, because of optimization that your compiler may perform, the data references can be invalid. Instead, use an approach like this:

extern long A5Size(void);
extern void A5Init(void *);
typedef    struct GlobalType {
    StringHandle    aString;
} GlobalType;
GlobalType    myGlobals;

/* This routine sets the initial values of our global data. */
OSErr InitGlobalData()
{
    OSErr    err;
    // Initialize our globals.
    myGlobals.aString = GetString(r_myStringID);
    err = ResError();
    if (!err) DetachResource(myGlobals.aString);
    return err;
}

/* Our override for the gxInitialize message. */
OSErr MyInitialize()
{
    OSErr    err;
    // Create an A5 world, then go initialize our global data.
    err = NewMessageGlobals(A5Size(), A5Init());
    if (!err) err = InitGlobalData();
    return err;

A detailed explanation of the problem accompanies the Kabooms printing extension sample on the Developer CD.

Back to top

QuickDraw GX LaserWriter driver produces "portable" PostScript

Date Written: 11/17/92

Last reviewed: 7/2/93

When a QuickDraw GX PostScript printer driver generates a file, will it work for Level 1 and Level 2 printers?

The LaserWriter driver bundled with QuickDraw GX produces a flavor of PostScript that we call "portable." This flavor is meant to work on the widest range of printing devices, be they Level 1 or 2, color or black and white.

Back to top

QuickDraw GX PostScript Level 2 features used

Date Written: 11/17/92

Last reviewed: 7/2/93

What PostScript Level 2 features does the QuickDraw GX printing mechanism take advantage of?

The Level 2 features used in QuickDraw GX mostly have to do with patterns, text, and bitmaps:

  • QuickDraw GX patterns are converted into Level 2 pattern dictionaries when going to a Level 2 printer. The actual PostScript code emitted by the driver differs little with respect to patterns when going to Level 1 or Level 2. However, the procedures defined in the header do something entirely different on a Level 2 printer.
  • Line layout in QuickDraw GX takes advantage of the xshow, yshow, and xyshow operators when it makes sense to do so.
  • The Level 2 rectangle operators are used in Level 2, though this happens in the procedures defined in the header rather than in PostScript code from the driver.
  • On Level 2 printers, the indexed color spaces are used for printing bitmaps up to eight bits deep.
  • The plan is to use Level 2 device-independent color when possible.

Back to top

QuickDraw GX printer drivers and color option

Date Written: 9/14/92

Last reviewed: 7/2/93

The LaserWriter driver before the QuickDraw GX version has an option to print in Color/Grayscale or Black & White. Why isn't this option in the QuickDraw GX LaserWriter driver?

The Color/Grayscale option was added to the LaserWriter driver only for compatibility reasons. At the time, some applications couldn't deal with the color option (specifically with cGrafPorts), so a Black & White mode was also provided. The Black & White mode exhibited the same functionality as the earlier LaserWriter driver 5.2.

Because most applications are color compatible now, the option was removed from the QuickDraw GX printer drivers. Some people reported that the option let them print faster when they chose Black & White. This was true because of quirks in the earlier LaserWriter driver version. Under QuickDraw GX, this shouldn't be a problem. If it turns out to be a problem for your driver, you could incorporate black-and-white threshold printing into your "rough draft mode" code. The QuickDraw GX LaserWriter driver always prints in color.



Back to top

Downloadables

Acrobat gif

Acrobat version of this Note (48K).

Download



Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.