<!--
{
  "availability" : [
    "iOS: 4.2.0 -",
    "iPadOS: 4.2.0 -",
    "macCatalyst: 13.1.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIPrintFormatter/draw(in:forPageAt:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIPrintFormatter(im)drawInRect:forPageAtIndex:"
  },
  "title" : "draw(in:forPageAt:)"
}
-->

# draw(in:forPageAt:)

Draws the portion of a print formatter’s content for the specified area of the specified page.

```
func draw(in rect: CGRect, forPageAt pageIndex: Int)
```

## Parameters

`rect`

The area in which to draw the content.

`pageIndex`

The number of the page of content to draw.

## Discussion

This method is called by the default implementation of `drawPrintFormatter:forPageAtIndex:` of the [`UIPrintPageRenderer`](/documentation/UIKit/UIPrintPageRenderer) class for each print formatter associated with a page.

---

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)