<!--
{
  "availability" : [
    "iOS: 3.2.0 -",
    "iPadOS: 3.2.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIGraphicsBeginPDFPageWithInfo(_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:@F@UIGraphicsBeginPDFPageWithInfo"
  },
  "title" : "UIGraphicsBeginPDFPageWithInfo(_:_:)"
}
-->

# UIGraphicsBeginPDFPageWithInfo(_:_:)

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

```
func UIGraphicsBeginPDFPageWithInfo(_ bounds: CGRect, _ pageInfo: [AnyHashable : Any]?)
```

## Parameters

`bounds`

A rectangle that specifies the size and location of the new PDF page. This rectangle corresponds to the media box rectangle for the page.

`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>. The dictionary is retained by the new page, so you may release it after this function returns.

    Specify     `nil`     if you do not want to associate any additional information with the page.

## 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 <doc://com.apple.documentation/documentation/CoreGraphics/kCGPDFContextMediaBox> key of the `pageInfo` dictionary, or to the value in the `bounds` parameter if the dictionary does not contain the key.

If the current graphics context is not a PDF context, this function does nothing.

You must call this function or the [`UIGraphicsBeginPDFPageWithInfo(_:_:)`](/documentation/UIKit/UIGraphicsBeginPDFPageWithInfo(_:_:)) function before you issue any drawing commands.

---

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)