![]() |
PMSetPageRange |
||||
Header: | PMCore.h | Carbon status: | Supported | |
Sets the valid range of pages that can be printed.
OSStatus PMSetPageRange ( PMPrintSettings printSettings, UInt32 minPage, UInt32 maxPage );
A PMPrintSettings object.
The minimum allowable page number. On Mac OS X, this value will appear as the default in the From field of the Print dialog box.
The maximum allowable page number. On Mac OS X, this value will appear as the default in the To field of the Print dialog box. Pass the constant kPMPrintAllPages to allow the user to print the entire document. On Mac OS X, this causes the All button to be selected,and clears the From and To fields of the Print dialog box.
A result code. A result code. See
This function allows applications running on Mac OS X to set the minimum and maximum page numbers that can be printed for a document. If the user enters a value outside of this range in the Print dialog box, the Carbon Printing Manager displays an alert message.
Because the Classic Printing Manager does not support this feature, the page range cannot be automatically enforced in the Print dialog box on Mac OS 8 or 9. If your application displays the Print dialog box and the user enters values outside of the range you specify with PMSetPageRange, the values entered by the user will take precedence. (You can use the PMGetFirstPage and PMGetLastPage functions to obtain the values entered by the user in the Print dialog box.)
In all cases, if your application sets a range with PMSetPageRange and subsequently calls PMSetFirstPage or PMSetLastPage with values outside of the specified range, the Carbon Printing Manager will return an error result of kPMValueOutOfRange. Conversely, if your application calls PMSetPageRange after calling PMSetFirstPage or PMSetLastPage (or after displaying the Print dialog box), the page range specified by PMSetPageRange will take precedence, and the first and last page values will be adjusted accordingly.
Valid within a printing session after creating a print settings object.
Supported in Carbon. Available in Carbon 1.0.2 and later.
The PMSetPageRangefunction replaces the Printing Manager opcode kPrinterDirectOpCode in kPDVerifySelect mode, and sets information previously stored in the iFstPage and iLstPage fields of the Printing Manager structure TPrJob.
© 2000 Apple Computer, Inc. (Last Updated 7/17/2000)