---
title: "preparePageLayout(_:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsdocument/preparepagelayout(_:)"
---

# preparePageLayout(_:)

Adds document-specific content to the Page Layout panel.

## Declaration

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

## Parameters

- `pageLayout`: The page layout panel to prepare.

## Return Value

Return Value true if successfully prepared; otherwise, false.

## Discussion

Discussion The runModalPageLayoutWithPrintInfo: and 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 true.

## See Also

### Printing the Document

- [printInfo](appkit/nsdocument/printinfo.md)
- [runModalPageLayout(with:delegate:didRun:contextInfo:)](appkit/nsdocument/runmodalpagelayout(with:delegate:didrun:contextinfo:).md)
- [runModalPrintOperation(_:delegate:didRun:contextInfo:)](appkit/nsdocument/runmodalprintoperation(_:delegate:didrun:contextinfo:).md)
- [shouldChangePrintInfo(_:)](appkit/nsdocument/shouldchangeprintinfo(_:).md)
- [print(withSettings:showPrintPanel:delegate:didPrint:contextInfo:)](appkit/nsdocument/print(withsettings:showprintpanel:delegate:didprint:contextinfo:).md)
- [printOperation(withSettings:)](appkit/nsdocument/printoperation(withsettings:).md)
- [pdfPrintOperation](appkit/nsdocument/pdfprintoperation.md)
- [saveToPDF(_:)](appkit/nsdocument/savetopdf(_:).md)
