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

# preparePageLayout(_:)

Adds document-specific content to the Page Layout panel.

```
func preparePageLayout(_ pageLayout: NSPageLayout) -> Bool
```

## Parameters

`pageLayout`

The page layout panel to prepare.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if successfully prepared; otherwise, <doc://com.apple.documentation/documentation/Swift/false>.

## Discussion

The [`runModalPageLayoutWithPrintInfo:`](/documentation/AppKit/NSDocument/runModalPageLayoutWithPrintInfo:) and [`runModalPageLayout(with:delegate:didRun:contextInfo:)`](/documentation/AppKit/NSDocument/runModalPageLayout(with:delegate:didRun:contextInfo:)) methods call this method to allow the document to customize the Page Layout panel `pageLayout`. You might use this method to add a document-related accessory view.

The default implementation returns <doc://com.apple.documentation/documentation/Swift/true>.

---

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)