pRecH& = PRHANDLE
FEBRUARY, 2002 (Release 6)
This function returns a handle to the print record. The print record (also called a "TPrint record") contains useful information about the printer and about the current print job (if any). For a complete description of the contents of the print record, see the "Printing Manager" chapter of Inside Macintosh: Imaging with QuickDraw. A few of the more useful fields from this record are listed here:
This gives the print page rectangle. You can get the width and height of the page as follows:
pageWidth = pRecH&..prInfo.rPage.right% - ¬
<spacer type="horizontal" size="198">pRecH&..prInfo.rPage.left%
pageHeight = pRecH&..prInfo.rPage.bottom% - ¬
<spacer type="horizontal" size="198">pRecH&..prInfo.rPage.top%
Use these numbers to determine how much room is available for text and graphics. The page rectangle is affected by the user's selections in the "Page Setup" dialog: for example, if the user selects "landscape" mode, the page width will be greater than the page height.
pRecH&..prJob.iFstPage%; pRecH&..prJob.iLstPage%These numbers indicate the first and last pages which the user wants to print. Your program should not print any pages outside of this range.
The number of copies to print. This is the number of times your program should send the selected pages to the printer. Note that many newer printer drivers will always set this number to 1; such printer drivers will handle multiple copies internally.
PRHANDLE is partially emulated for Carbon. FB creates a 120 byte handle and fills in a few standard rectangles and other values so that programs won't be so likely to break during the transition period to OS X. But these emulations are not something that you should depend on in all future versions of the IDE.
DEF PAGE; DEF LPRINT; Inside Macintosh; Imaging with QuickDraw