Important: The information in this document is obsolete and should not be used for new development.
PrGeneral
Use thePrGeneral
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 thegetRslDataOp
opcode in theiOpCode
field of this record.
- A
TSetRslBlk
record (described on page 9-51) for setting the resolution of aTPrint
record. In the fields of this record, you specify thesetRslOp
opcode, a handle to aTPrint
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 thegetRotnOp
opcode and a handle to aTPrint
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 thedraftBitsOp
ornoDraftBitsOp
opcode and a handle to aTPrint
record.DESCRIPTION
To select which action you want thePrGeneral
procedure to undertake, you pass an opcode in theiOpCode
field of the record that thepData
parameter points to.Use the
PrGeneral
procedure with the valuegetRslDataOp
in theiOpCode
field of aTGetRslBlk
record when you want to determine the resolutions supported by the current printer driver. ThePrGeneral
procedure returns information about the resolutions that the printer driver supports in thexRslRg
,yRslRg
,iRslRecCnt
, andrgRslRec
fields of theTGetRslBlk
record.Use the
PrGeneral
procedure with the valuesetRslOp
in theiOpCode
field of theTSetRslBlk
record when you want to set the resolution of aTPrint
record. When called with thesetRslOp
opcode,PrGeneral
sets the fields relating to x and y resolution in the specifiedTPrint
record according to the values of theiXRsl
andiYRsl
fields of theTSetRslBlk
record.Use the
PrGeneral
procedure with the valuegetRotnOp
in theiOpCode
field of theTGetRotnBlk
record when you want to determine whether aTPrint
record specifies landscape orientation. ThePrGeneral
procedure returns in thefLandscape
field of this record a Boolean value indicating whether theTPrint
record specifies landscape orientation. When the user chooses landscape orientation from the style dialog box, thePrStlDialog
function (described on page 9-58) modifies theTPrint
record accordingly.Use the
PrGeneral
procedure with the valuedraftBitsOp
in theiOpCode
field of theTDftBitsBlk
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 thenoDraftBitsOp
opcode to cancel the use of enhanced draft-quality printing.If you want to force enhanced draft-quality printing, you should call
PrGeneral
with thedraftBitsOp
opcode before displaying the print dialog boxes to the user. Use of thedraftBitsOp
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 theiError
field of each of these records. You should check the value in theiError
field after each use ofPrGeneral
. You should also use thePrError
function (which returns the result code left by the last Printing Manager routine) after checking theiError
field, to be sure that no additional errors were generated. IfPrError
returns the result coderesNotFound
after you callPrGeneral
, then the current printer driver doesn't supportPrGeneral
. You should clear the error by calling thePrSetError
procedure and passingnoErr
in its parameter; otherwise,PrError
might still contain this error the next time you check it. (ThePrError
function and thePrSetError
procedure are described on page 9-72 and page 9-75, respectively.)SPECIAL CONSIDERATIONS
If you callPrGeneral
with thedraftBitsOp
opcode after using thePrJobDialog
orPrDlgMain
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 thePrGeneral
procedure are
Trap macro Selector _PrGlue $70070480 RESULT CODES
opNotImpl 2 Printer driver does not support this opcode noSuchRsl 1 Requested resolution not supported by the currently selected printer noErr 0 No error SEE ALSO
See Listing 9-4 on page 9-28 for an example of how to use thegetRslDataOp
opcode to determine what printer resolutions are available for the current printer. The same listing shows an example of how to use thesetRslOp
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
andnoDraftBitsOp
opcodes to force the use of or to cancel the use of enhanced draft-quality printing.