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

# drawContentForPage(at:in:)

Draws the content of a page.

```
func drawContentForPage(at pageIndex: Int, in contentRect: CGRect)
```

## Parameters

`pageIndex`

The index of the page on which to draw content.

`contentRect`

The area in which to draw content, in the coordinate system of the printable rectangle. This area is equal to [`printableRect`](/documentation/UIKit/UIPrintPageRenderer/printableRect) minus [`headerHeight`](/documentation/UIKit/UIPrintPageRenderer/headerHeight) and [`footerHeight`](/documentation/UIKit/UIPrintPageRenderer/footerHeight).

## Discussion

The default implementation of this method does nothing. Override this method to draw the content of the specified page.

The system configures this method for drawing to the current graphics context according to [`UIGraphicsGetCurrentContext()`](/documentation/UIKit/UIGraphicsGetCurrentContext()).

---

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)