---
title: "drawPrintFormatter(_:forPageAt:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uiprintpagerenderer/drawprintformatter(_:forpageat:)"
---

# drawPrintFormatter(_:forPageAt:)

Performs custom drawing in addition to the specified print formatter’s drawing for a page.

## Declaration

```swift
func drawPrintFormatter(_ printFormatter: UIPrintFormatter, forPageAt pageIndex: Int)
```

## Parameters

- `printFormatter`: A doc://com.apple.uikit/documentation/UIKit/UIPrintFormatter object associated with the page at pageIndex.
- `pageIndex`: The index of the page for printFormatter to draw on.

## Discussion

Discussion The system invokes this method for each print formatter associated with the specified page. The default implementation invokes the draw(in:forPageAt:) method of each UIPrintFormatter object. Override this method to intermix custom drawing with the formatter drawing — for example, by adding an overlay or underlay graphic. Call draw(in:forPageAt:) to have the print formatter draw its portion of the page. The system configures this method for drawing to the current graphics context according to UIGraphicsGetCurrentContext().

## See Also

### Drawing a page

- [drawPage(at:in:)](uikit/uiprintpagerenderer/drawpage(at:in:).md)
- [drawHeaderForPage(at:in:)](uikit/uiprintpagerenderer/drawheaderforpage(at:in:).md)
- [drawContentForPage(at:in:)](uikit/uiprintpagerenderer/drawcontentforpage(at:in:).md)
- [drawFooterForPage(at:in:)](uikit/uiprintpagerenderer/drawfooterforpage(at:in:).md)
