Contents

PMGetLastPage(_:_:)

Obtains the number of the last page to be printed.

Declaration

func PMGetLastPage(_ printSettings: PMPrintSettings, _ last: UnsafeMutablePointer<UInt32>) -> OSStatus

Parameters

  • printSettings:

    The print settings object whose last page number you want to obtain.

  • last:

    A pointer to your UInt32 variable. On return, the variable contains the page number of the last page to print.

Return Value

A result code. See Result Codes.

Discussion

You use this function to obtain the page number entered by the user in the To field of the Print dialog. If the user did not enter a value, the function returns the value of the previous call to PMSetLastPage, if any, or a default value.

You should not look for the constant kPMPrintAllPages. That constant is used only with the PMSetLastPage and PMSetPageRange functions to specify a last page. It is not returned by the PMGetLastPage function.

See Also

Accessing Data in Print Settings Objects