---
title: "locationOfPrintRect(_:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsview/locationofprintrect(_:)"
---

# locationOfPrintRect(_:)

Invoked by printView(_:) to determine the location of the region of the view being printed on the physical page.

## Declaration

```swift
func locationOfPrintRect(_ rect: NSRect) -> NSPoint
```

## Parameters

- `rect`: A rectangle defining a region of the view; it is expressed in the default coordinate system of the page.

## Return Value

Return Value A point to be used for setting the origin for aRect, whose size the view can examine in order to properly place it. It is expressed in the default coordinate system of the page.

## Discussion

Discussion The default implementation places aRect according to the status of the NSPrintInfo object for the print job. By default it places the image in the upper-left corner of the page, but if the NSPrintInfo methods isHorizontallyCentered or isVerticallyCentered return true, it centers a single-page image along the appropriate axis. A multiple-page document, however, is always placed so the divided pieces can be assembled at their edges.

## See Also

### Handling Pagination

- [heightAdjustLimit](appkit/nsview/heightadjustlimit.md)
- [widthAdjustLimit](appkit/nsview/widthadjustlimit.md)
- [adjustPageWidthNew(_:left:right:limit:)](appkit/nsview/adjustpagewidthnew(_:left:right:limit:).md)
- [adjustPageHeightNew(_:top:bottom:limit:)](appkit/nsview/adjustpageheightnew(_:top:bottom:limit:).md)
- [knowsPageRange(_:)](appkit/nsview/knowspagerange(_:).md)
- [rectForPage(_:)](appkit/nsview/rectforpage(_:).md)
