PrOpenPage
Rect *rPgFrame ; address of a rectangle for scaling; 0=none PrOpenPage initializes fields of a printing grafPort. Use it before using any Quickdraw functions to draw on the page. The page will be printed only if
it falls within the page range given in the print record used in the previous
pPrPort is the address of a 178-byte TPrPort record. This must be a value rPgFrame is the address of a rectangle to be used as the Quickdraw picture
frame used in scaling this page. Pass a NIL pointer (i.e., rPgFrame =
0) if you don't want the output to be scaled.
Notes: PrOpenPage totally re- initializes the printing grafPort. Therefore, you must set the font, font size, pen size, and so forth for each page in the
document.
drawing calls you make will not be added to the page. You can still make calls
The Printing Manager keeps track of the number of calls to PrOpenPage and assumes that the first is for page 1, the second for page 2, etc. Pages
outside of the page range set in the print record used in the previous call to
Thus, you can output all pages in a document and let the Printing Manager
"clip" the unwanted ones. However, this can be very slow. A better
approach is to start with the first page selected by the user in the
first = (*hPrtRec)-prJob.iFstPage; /* get real range from TPrint */ last = (*hPrtRec)-prJob.iLstPage;
(*hPrtRec)-prJob.iFstPage = 1; /* set a pretend range */
(*hPrtRec)-prJob.iLstPage = 9999;
for ( pgNum= first; pgNum
MyDrawPage( pgNum ); /* use Quickdraw commands to draw */
}
Each call to PrOpenPage must be balanced by a subsequent call to