<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSPageLayout",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSPageLayout"
  },
  "title" : "NSPageLayout"
}
-->

# NSPageLayout

A panel that queries the user for information such as paper type and orientation.

```
@MainActor class NSPageLayout
```

## Overview

A page layout panel is typically displayed in response to the user selecting the Page Setup menu item. You obtain an instance with the [`pageLayout`](/documentation/AppKit/NSPageLayout/pageLayout) class method. The pane can then be run as a sheet using [`beginSheet(with:modalFor:delegate:didEnd:contextInfo:)`](/documentation/AppKit/NSPageLayout/beginSheet(with:modalFor:delegate:didEnd:contextInfo:)) or modally using [`runModal()`](/documentation/AppKit/NSPageLayout/runModal()) or [`runModal(with:)`](/documentation/AppKit/NSPageLayout/runModal(with:)).

For design guidance, see [Human Interface Guidelines](https://developer.apple.com/design/human-interface-guidelines/macos/system-capabilities/printing#page-setup-dialogs).

## Topics

### Creating the page layout object

[`+  pageLayout`](/documentation/AppKit/NSPageLayout/pageLayout)

Returns a newly created page layout object.

### Running the page setup dialog

[`-  beginSheetUsingPrintInfo:onWindow:completionHandler:`](/documentation/AppKit/NSPageLayout/beginSheet(using:on:completionHandler:))

[`-  beginSheetWithPrintInfo:modalForWindow:delegate:didEndSelector:contextInfo:`](/documentation/AppKit/NSPageLayout/beginSheet(with:modalFor:delegate:didEnd:contextInfo:))

Presents a page setup sheet for the specified print info object, document-modal relative to the specified window.

[`-  runModal`](/documentation/AppKit/NSPageLayout/runModal())

Displays the page layout panel and begins the modal loop using the shared print info object.

[`-  runModalWithPrintInfo:`](/documentation/AppKit/NSPageLayout/runModal(with:))

Displays the page layout panel and begins the modal loop using the specified print info object.

### Customizing the page setup dialog

[`-  addAccessoryController:`](/documentation/AppKit/NSPageLayout/addAccessoryController(_:))

Adds the specified controller of an accessory view to be presented in the page setup panel.

[`-  removeAccessoryController:`](/documentation/AppKit/NSPageLayout/removeAccessoryController(_:))

Removes the specified controller of an accessory view.

[`accessoryControllers`](/documentation/AppKit/NSPageLayout/accessoryControllers)

An array of accessory view controllers belonging to the page layout panel.

### Accessing the printing information

[`printInfo`](/documentation/AppKit/NSPageLayout/printInfo)

The printing information object used when the page layout panel is run.

[`NSPrintInfo`](/documentation/AppKit/NSPrintInfo)

An object that stores information that’s used to generate printed output.

[`Result`](/documentation/AppKit/NSPageLayout/Result)

### Deprecated

[`-  accessoryView`](/documentation/AppKit/NSPageLayout/accessoryView)

Returns the page layout panel’s accessory view.

[`-  setAccessoryView:`](/documentation/AppKit/NSPageLayout/setAccessoryView:)

Adds a view object to the page layout panel.

[`-  readPrintInfo`](/documentation/AppKit/NSPageLayout/readPrintInfo)

Sets the page layout’s values to those stored in the print info object used when the page layout panel is run.

[`-  writePrintInfo`](/documentation/AppKit/NSPageLayout/writePrintInfo)

Writes the page layout’s values to the print info object used when the page layout panel is run.

## Relationships

### Conforms To

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`Hashable`](/documentation/Swift/Hashable)

[`Equatable`](/documentation/Swift/Equatable)

[`Sendable`](/documentation/Swift/Sendable)

[`CVarArg`](/documentation/Swift/CVarArg)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)