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

# runPageLayout(_:)

The action method invoked in the receiver as first responder when the user chooses the Page Setup menu command.

```
@IBAction func runPageLayout(_ sender: Any?)
```

## Parameters

`sender`

The control sending the message.

## Discussion

The default implementation invokes [`runModalPageLayout(with:delegate:didRun:contextInfo:)`](/documentation/AppKit/NSDocument/runModalPageLayout(with:delegate:didRun:contextInfo:)) with the document’s current NSPrintInfo object as argument; if the user clicks the OK button and the document authorizes changes to its printing information ([`shouldChangePrintInfo(_:)`](/documentation/AppKit/NSDocument/shouldChangePrintInfo(_:))), the method sets the document’s new `NSPrintInfo` object and increments the document’s change count.

## See Also

[`-  updateChangeCount:`](/documentation/AppKit/NSDocument/updateChangeCount(_:))

Updates the receiver’s change count according to the given change type.

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

The printing information associated with the document.



---

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)