Contents

PMSessionCreatePageFormatList(_:_:_:)

Obtains a list of page format objects, each of which describes a paper size available on the specified printer.

Declaration

func PMSessionCreatePageFormatList(_ printSession: PMPrintSession, _ printer: PMPrinter?, _ pageFormatList: UnsafeMutablePointer<Unmanaged<CFArray>?>) -> OSStatus

Parameters

  • printSession:

    The current printing session.

  • printer:

    The printer whose list of page sizes you want to enumerate.

  • pageFormatList:

    A pointer to your Cfarray variable. On return, the variable refers to a Core Foundation array that contains the page format (PMPageFormat) objects associated with the specified printer. You are responsible for releasing the array. Each page format object describes a paper size available for the specified printer. If the function fails, then on return the array is NULL.

Return Value

A result code. See Result Codes.

Discussion

You must call this function between the creation and release of a printing session. See the function PMCreateSession(_:).

You can use this function to find the available sheet sizes (and the imageable area for them) for a given printer. After you obtain the page format list, you can call the function PMGetUnadjustedPaperRect(_:_:) for each page format object in the list to obtain the sheet rectangle size. Once you find the paper size you want, call PMGetUnadjustedPageRect(_:_:) to obtain the imageable area for that paper size.

See Also

Creating and Using Page Format Objects