---
title: "beginPage(withBounds:pageInfo:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uigraphicspdfrenderercontext/beginpage(withbounds:pageinfo:)"
---

# beginPage(withBounds:pageInfo:)

Marks the beginning of a new page in the PDF context and configures it using the specified values.

## Declaration

```swift
func beginPage(withBounds bounds: CGRect, pageInfo: [String : Any])
```

## Parameters

- `bounds`: A rectangle that specifies the size and location of the new PDF page. This rectangle corresponds to the media box in PDF terminology.
- `pageInfo`: A dictionary that specifies additional page-related information, such as the boxes that define different parts of the page. For a list of keys you can include in this dictionary, see Box Keys in doc://com.apple.documentation/documentation/CoreGraphics/auxiliary-dictionary-keys.

## Discussion

Discussion This function ends any previous page before beginning a new one. It sets the media box of the new page to the value in the kCGPDFContextMediaBox key of the pageInfo dictionary, or to the value in the bounds parameter if the dictionary does not contain the key.

## See Also

### Marking new pages

- [beginPage()](uikit/uigraphicspdfrenderercontext/beginpage().md)
