Important: The information in this document is obsolete and should not be used for new development.
PrGeneral
Use thePrGeneralprocedure 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
TGetRslBlkrecord (described on page 9-50) for determining resolutions of the current printer. You set thegetRslDataOpopcode in theiOpCodefield of this record.- A
TSetRslBlkrecord (described on page 9-51) for setting the resolution of aTPrintrecord. In the fields of this record, you specify thesetRslOpopcode, a handle to aTPrintrecord (described on page 9-41), and the new resolutions for the x and y directions.- A
TGetRotnBlkrecord (described on page 9-53) when determining whether to print in landscape orientation. You specify thegetRotnOpopcode and a handle to aTPrintrecord in the fields of this record.- A
TDftBitsBlkrecord (described on page 9-52) to use or cancel enhanced draft-quality printing. You specify in the fields of this record either thedraftBitsOpornoDraftBitsOpopcode and a handle to aTPrintrecord.DESCRIPTION
To select which action you want thePrGeneralprocedure to undertake, you pass an opcode in theiOpCodefield of the record that thepDataparameter points to.Use the
PrGeneralprocedure with the valuegetRslDataOpin theiOpCodefield of aTGetRslBlkrecord when you want to determine the resolutions supported by the current printer driver. ThePrGeneralprocedure returns information about the resolutions that the printer driver supports in thexRslRg,yRslRg,iRslRecCnt, andrgRslRecfields of theTGetRslBlkrecord.Use the
PrGeneralprocedure with the valuesetRslOpin theiOpCodefield of theTSetRslBlkrecord when you want to set the resolution of aTPrintrecord. When called with thesetRslOpopcode,PrGeneralsets the fields relating to x and y resolution in the specifiedTPrintrecord according to the values of theiXRslandiYRslfields of theTSetRslBlkrecord.Use the
PrGeneralprocedure with the valuegetRotnOpin theiOpCodefield of theTGetRotnBlkrecord when you want to determine whether aTPrintrecord specifies landscape orientation. ThePrGeneralprocedure returns in thefLandscapefield of this record a Boolean value indicating whether theTPrintrecord specifies landscape orientation. When the user chooses landscape orientation from the style dialog box, thePrStlDialogfunction (described on page 9-58) modifies theTPrintrecord accordingly.Use the
PrGeneralprocedure with the valuedraftBitsOpin theiOpCodefield of theTDftBitsBlkrecord 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 thenoDraftBitsOpopcode to cancel the use of enhanced draft-quality printing.If you want to force enhanced draft-quality printing, you should call
PrGeneralwith thedraftBitsOpopcode before displaying the print dialog boxes to the user. Use of thedraftBitsOpopcode 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
PrGeneralprocedure returns error information in theiErrorfield of each of these records. You should check the value in theiErrorfield after each use ofPrGeneral. You should also use thePrErrorfunction (which returns the result code left by the last Printing Manager routine) after checking theiErrorfield, to be sure that no additional errors were generated. IfPrErrorreturns the result coderesNotFoundafter you callPrGeneral, then the current printer driver doesn't supportPrGeneral. You should clear the error by calling thePrSetErrorprocedure and passingnoErrin its parameter; otherwise,PrErrormight still contain this error the next time you check it. (ThePrErrorfunction and thePrSetErrorprocedure are described on page 9-72 and page 9-75, respectively.)SPECIAL CONSIDERATIONS
If you callPrGeneralwith thedraftBitsOpopcode after using thePrJobDialogorPrDlgMainfunction, 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 thePrGeneralprocedure 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 thegetRslDataOpopcode to determine what printer resolutions are available for the current printer. The same listing shows an example of how to use thesetRslOpopcode to set the resolution for the current printer.See Listing 9-5 on page 9-30 for an example of using the
getRotnOpopcode to determine if the user has selected landscape orientation.See "Enhancing Draft-Quality Printing" on page 9-31 for more information on using the
draftBitsOpandnoDraftBitsOpopcodes to force the use of or to cancel the use of enhanced draft-quality printing.