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 / Printing a Document


PrOpenPage

Use the PrOpenPage procedure to begin to print a new page.

PROCEDURE PrOpenPage (pPrPort: TPPrPort; pPageFrame: TPRect);
pPrPort
A pointer to a printing graphics port. (The TPrPort record that defines a printing graphics port is described on page 9-48.)
pPageFrame

For deferred printing, a pointer to a rectangle to be used as the QuickDraw picture frame for this page. To print the page with no scaling, specify NIL to use the rectangle in the rPage field of the TPrInfo record as the picture frame.
DESCRIPTION
The PrOpenPage procedure sets up the printing graphics port to print a new page. After calling PrOpenPage, your application should draw the data for that page and then call the PrClosePage procedure, which is described in the next section.

The page is printed only if it falls within the page range stored in the TPrJob record contained in the TPrint record supplied to the PrOpenDoc function (described on page 9-64).

If the user has chosen deferred printing for a printer driver that supports deferred printing, the driver uses the QuickDraw procedure DrawPicture to scale the rectangle named in the pPageFrame parameter so that it coincides with the rectangle specified in the rPage field of the TPrInfo record (which is contained in the TPrint record supplied to the PrOpenDoc function). Unless you want the printout to be scaled, you should set the pPageFrame parameter to NIL--this uses the rectangle in the rPage field as the picture frame, so that the page is printed with no scaling.

SPECIAL CONSIDERATIONS
You must balance every call to PrOpenPage with a call to PrClosePage.

The printing graphics port is completely reinitialized by PrOpenPage. Therefore, you must set graphics port features such as the font family and font size for every page that you draw after you call this procedure.

Don't call the QuickDraw function OpenPicture while a page is open (after a call to PrOpenPage but before calling PrClosePage). You can, however, call the DrawPicture procedure at any time.

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

SEE ALSO
For an example of the use of PrOpenPage, see Listing 9-2 beginning on page 9-18. The QuickDraw routines OpenPicture and DrawPicture are described in the chapter "Pictures" in this book.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996