Contents

PMSetOrientation(_:_:_:)

Sets the page orientation for printing.

Declaration

func PMSetOrientation(_ pageFormat: PMPageFormat, _ orientation: PMOrientation, _ lock: Bool) -> OSStatus

Parameters

  • pageFormat:

    The page format object whose page orientation you want to set.

  • orientation:

    A constant specifying the desired page orientation. Supported values are:

    • kPMPortrait

    • kPMLandscape

    • kPMReversePortrait (macOS 10.5 and later)

    • kPMReverseLandscape

    See Pmorientation for a full description of the values you can use to specify page orientation.

  • lock:

    The lock state of the setting. You should pass kPMUnlocked. Locking is not supported at this time.

Return Value

A result code. See Result Codes.

Discussion

In OS X v10.4 and earlier, if you want to set the page orientation you need to call this function before initiating the print job (for example, by calling PMSessionBeginCGDocument). The page orientation you set applies to the entire print job. In macOS 10.5 and later, you can use this function to change the orientation of an individual page in a print job by passing the updated page format to PMSessionBeginPage or PMSessionBeginPageNoDialog.

See Also

Accessing Data in Page Format Objects