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 / Optimizing Printing


PrGeneral

Use the PrGeneral procedure to achieve the highest possible resolution on the current printer, verify page orientation, and allow enhanced draft-quality printing.

PROCEDURE PrGeneral (pData: Ptr);
pData
A pointer to one of these four records, depending on your purpose for calling PrGeneral:
A TGetRslBlk record (described on page 9-50) for determining resolutions of the current printer. You set the getRslDataOp opcode in the iOpCode field of this record.
A TSetRslBlk record (described on page 9-51) for setting the resolution of a TPrint record. In the fields of this record, you specify the setRslOp opcode, a handle to a TPrint record (described on page 9-41), and the new resolutions for the x and y directions.
A TGetRotnBlk record (described on page 9-53) when determining whether to print in landscape orientation. You specify the getRotnOp opcode and a handle to a TPrint record in the fields of this record.
A TDftBitsBlk record (described on page 9-52) to use or cancel enhanced draft-quality printing. You specify in the fields of this record either the draftBitsOp or noDraftBitsOp opcode and a handle to a TPrint record.
DESCRIPTION
To select which action you want the PrGeneral procedure to undertake, you pass an opcode in the iOpCode field of the record that the pData parameter points to.

Use the PrGeneral procedure with the value getRslDataOp in the iOpCode field of a TGetRslBlk record when you want to determine the resolutions supported by the current printer driver. The PrGeneral procedure returns information about the resolutions that the printer driver supports in the xRslRg, yRslRg, iRslRecCnt, and rgRslRec fields of the TGetRslBlk record.

Use the PrGeneral procedure with the value setRslOp in the iOpCode field of the TSetRslBlk record when you want to set the resolution of a TPrint record. When called with the setRslOp opcode, PrGeneral sets the fields relating to x and y resolution in the specified TPrint record according to the values of the iXRsl and iYRsl fields of the TSetRslBlk record.

Use the PrGeneral procedure with the value getRotnOp in the iOpCode field of the TGetRotnBlk record when you want to determine whether a TPrint record specifies landscape orientation. The PrGeneral procedure returns in the fLandscape field of this record a Boolean value indicating whether the TPrint record specifies landscape orientation. When the user chooses landscape orientation from the style dialog box, the PrStlDialog function (described on page 9-58) modifies the TPrint record accordingly.

Use the PrGeneral procedure with the value draftBitsOp in the iOpCode field of the TDftBitsBlk record when you want to use enhanced draft-quality printing. Typically, you use enhanced draft-quality printing when you want to print bitmaps as well as text in a draft-quality printout on an ImageWriter printer. Use the noDraftBitsOp opcode to cancel the use of enhanced draft-quality printing.

If you want to force enhanced draft-quality printing, you should call PrGeneral with the draftBitsOp opcode before displaying the print dialog boxes to the user. Use of the draftBitsOp opcode may cause the printer driver to make some items in its print dialog boxes inactive; for example, the ImageWriter printer driver makes the landscape icon in the style dialog box (landscape printing is not available for draft-quality printing) and the Best and Faster buttons in the job dialog box inactive.

The PrGeneral procedure returns error information in the iError field of each of these records. You should check the value in the iError field after each use of PrGeneral. You should also use the PrError function (which returns the result code left by the last Printing Manager routine) after checking the iError field, to be sure that no additional errors were generated. If PrError returns the result code resNotFound after you call PrGeneral, then the current printer driver doesn't support PrGeneral. You should clear the error by calling the PrSetError procedure and passing noErr in its parameter; otherwise, PrError might still contain this error the next time you check it. (The PrError function and the PrSetError procedure are described on page 9-72 and page 9-75, respectively.)

SPECIAL CONSIDERATIONS
If you call PrGeneral with the draftBitsOp opcode after using the PrJobDialog or PrDlgMain function, and if the user chooses draft printing from the job dialog box, the ImageWriter does not print any bitmaps or pixel maps contained in the document.

Enhanced draft-quality printing is of limited usefulness, as described in "Enhancing Draft-Quality Printing" on page 9-31.

ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for the PrGeneral procedure are
Trap macroSelector
_PrGlue$70070480

RESULT CODES
opNotImpl2Printer driver does not support this opcode
noSuchRsl1Requested resolution not supported by the currently selected printer
noErr0No error
SEE ALSO
See Listing 9-4 on page 9-28 for an example of how to use the getRslDataOp opcode to determine what printer resolutions are available for the current printer. The same listing shows an example of how to use the setRslOp opcode to set the resolution for the current printer.

See Listing 9-5 on page 9-30 for an example of using the getRotnOp opcode to determine if the user has selected landscape orientation.

See "Enhancing Draft-Quality Printing" on page 9-31 for more information on using the draftBitsOp and noDraftBitsOp opcodes to force the use of or to cancel the use of enhanced draft-quality printing.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996