<!--
{
  "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/UIGraphicsSetPDFContextDestinationForRect(_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:@F@UIGraphicsSetPDFContextDestinationForRect"
  },
  "title" : "UIGraphicsSetPDFContextDestinationForRect(_:_:)"
}
-->

# UIGraphicsSetPDFContextDestinationForRect(_:_:)

Links a rectangular area on the current page to the specified jump destination.

```
func UIGraphicsSetPDFContextDestinationForRect(_ name: String, _ rect: CGRect)
```

## Parameters

`name`

A named destination in the PDF document. This is the same name you used when creating the jump destination using the [`UIGraphicsAddPDFContextDestinationAtPoint(_:_:)`](/documentation/UIKit/UIGraphicsAddPDFContextDestinationAtPoint(_:_:)) function.

`rect`

A rectangle on the current page of the PDF context.

## Discussion

You use this function to create live links within a PDF document. Tapping the specified rectangle in the PDF document causes the document to display the contents at the associated jump destination.

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

---

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)